How To

How to make concurrent requests with HttpClient in C#
By Tan Lee Published on Jan 21, 2025 1.19K

The HttpClient class is designed for making concurrent requests. It is thread-safe, meaning you can send multiple requests at the same time, whether from a single thread or multiple threads.

How to fix 'Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on'
By Tan Lee Published on Jul 08, 2024 2.25K

The error "Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on" typically occurs in multi-threaded applications when you try to update or interact with UI controls from a thread other than the one that created those controls.

How to convert string to list in C#
By Tan Lee Published on Dec 20, 2024 1.22K

In C#, you can convert a string to a list by following these steps.

How to Create Word Document in C#
By Tan Lee Published on Jan 17, 2025 536

Creating a Word document programmatically in C# can be achieved using the Microsoft.Office.Interop.Word library.

EF Core - SELECT Queries Involving Multiple Tables
By Tan Lee Published on Feb 06, 2025 279

When you design a database with related tables, it’s common to need data from more than one table or filter records based on values from another table.

EF Core - Aggregate SELECT queries
By Tan Lee Published on Feb 06, 2025 210

In this article, I’ll demonstrate how to use EF Core to aggregate data from a table, group it by a specific category, and apply conditions to include only certain groups.

EF Core - Basic SELECT Queries
By Tan Lee Published on Feb 06, 2025 170

In this article, I’ll walk you through how to execute basic SELECT queries in EF Core, using both LINQ and raw SQL queries.

EF Core - Creating a Composite Primary Key
By Tan Lee Published on Feb 06, 2025 228

A composite primary key consists of two or more columns that together serve as the primary key for a table.

C# LINQ Performance Optimization
By Tan Lee Published on Feb 06, 2025 203

LINQ (Language Integrated Query) is a highly effective feature in C# that streamlines complex data manipulations and queries.

LINQ Extension Methods in C#
By Tan Lee Published on Feb 06, 2025 229

This article explores LINQ (Language Integrated Query) extension methods in C#.

Tuples in C#
By Tan Lee Published on Feb 06, 2025 309

This guide introduces Tuples in C#, offering an exploration of their key features and uses. It aims to provide a thorough understanding of Tuples, highlighting their significance as a versatile and powerful data structure in C#.

String to Byte Array Conversion in C#
By Tan Lee Published on Feb 05, 2025 670

This tutorial will explore how to convert strings to byte arrays and vice versa in C#.