C# guides
Every published C# guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular C# guides
Most readLatest C# guides
Page 11 of 77C# ValueTask: When and How to Use It
C# ValueTask can reduce async allocations in hot paths, but it is not a drop-in replacement for Task. Learn when to use it, when to avoid it, and how to avoid common pitfalls.
C# ConfigureAwait: When and Why to Use It
Understand what C# ConfigureAwait does, when to use ConfigureAwait(false) in async libraries, and why UI code should keep the default await behavior to avoid context-capture pitfalls.
C# Task.Delay: Async Timing Without Blocking Threads
Practical C# Task.Delay guide covering async usage, cancellation, overload selection, runtime behavior, and common mistakes to avoid.
C# Task.WhenAny: Handling the First Completed Task
Learn how to use C# Task.WhenAny to await the first completed task, handle timeouts, filter for the first successful result, and manage cancellation.
C# Task.WhenAll: Awaiting Multiple Tasks
Use C# Task.WhenAll to await multiple independent asynchronous operations, collect their results, observe exceptions, and control concurrency.
C# await vs Task.Result: Avoid Blocking Async Code
c# await vs task result: Understand the difference between await and Task.Result in C#, why blocking on async tasks can cause deadlocks, and when it's acceptable.
C# Task Result: How to Access Values from Async Methods
Learn how to access a C# Task<T> result with await, .Result, and GetAwaiter().GetResult(), including exception handling and deadlock avoidance.
C# async void vs Task: Key Differences
C# async void vs Task: learn how their exception behavior and awaitability differ, when async void is required, and why async Task is the safer default.
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.
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.