Pages

Topics

Tools

↑↓navigate↵openescclose

All syntax guides

Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.

3,980 guides across 14 topics

Topics

Latest guides

Illustration of multiple asynchronous tasks merging into a single await point in C#
C#

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#asyncTask.WhenAllconcurrency
Comparison of await and Task.Result in C# showing a deadlock risk
C#

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.

async/awaitTaskdeadlockthread pool
Illustration of a C# Task returning a value, showing the flow from an async operation to the awaited result.
C#

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.

async/awaitTask<T>concurrency.NET
Diagram contrasting async void and async Task in C#, showing exception flow and awaitability
C#

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.

asyncC#Taskexception handling
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