Browse by Topic

Popular

Latest

Latest C# Posts

Illustration of an async void method with an unhandled exception causing an application crash, showing a broken chain link.
C#

c# async void: Exception Risks and Safe Patterns

Learn how c# async void behaves, why it can crash your app, and when it's acceptable to use in event handlers.

async-voidC#exception-handlingevent-handlers
Illustration of a C# async task showing a method returning a Task that is awaited, with a timeline of execution and a synchronization context.
C#

Using C# async Task: Async/Await in Practice

Learn how to use C# async Task effectively: declaring async methods, awaiting tasks, handling errors, avoiding common pitfalls, and understanding performance tradeoffs.

asyncawaitTaskconcurrency
Illustration of a C# task completing and returning a value, showing the flow from asynchronous operation to a finished result.
C#

C# Task Return Value: Using Task<TResult>

c# task return value: Learn how to return values from C# tasks using Task<TResult>, including declaration, creation, awaiting, exception handling, and performance trad...

Task<TResult>async/awaitValueTaskTaskCompletionSource
Illustration of a C# Task<T> generic type representing an asynchronous operation that returns a value.
C#

C# Task<T>: Returning Values from Async Methods

Learn how Task<T> works in C#, how to return values from async methods, and when to use it instead of plain Task.

C#Task<T>async/awaitTPL
A stylized C# Task icon representing asynchronous operations, with a checkmark and a clock to indicate completion and timing.
C#

Understanding C# Task and Async Programming

Learn how C# Task works, how to create and await tasks, handle errors and cancellation, and choose between Task and ValueTask for performance.

async/awaitTaskconcurrencyasynchronous programming
Illustration of a C# await keyword suspending a method and resuming later on a different thread
C#

C# await Keyword: Async Method Behavior

Understand how the C# await keyword suspends async methods, returns control to callers, and handles exceptions in async programming.

async programmingTaskasync/awaitC# concurrency
Illustration of a C# async method using await to offload work to a background task while the caller continues.
C#

C# Async Method: How async and await Work

Learn how async and await work in C#: return types, exception handling, cancellation, performance tradeoffs, and common pitfalls.

async/awaitTaskasynchronous programmingC# concurrency
Diagram of an async method state machine showing await points and thread yield to the thread pool.
C#

C# Async Await: Execution, Pitfalls, and Best Practices

Understand how C# async and await work under the hood, write correct async methods, and avoid deadlocks and performance traps.

async/awaitTask-based Asynchronous PatternC# ConcurrencyCancellationToken
Diagram showing object initialization with indexer assignment in C#.
C#

C# Index Initializer: Syntax and Usage

c# index initializer: Learn how to use index initializers in C# to set indexer values during object creation, with syntax examples and practical usage patterns.

C#Index InitializerObject InitializerIndexer
Diagram showing nested object initializer syntax in C# with braces and property assignments.
C#

C# Nested Object Initializer Syntax and Behavior

Learn how C# nested object initializers work, including the assignment and nested-member forms, collection initialization, common mistakes, and tradeoffs.

C#Object InitializerNested ObjectsCollection Initializer