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 8 of 77C# Using Statement vs Using Declaration
Understand the practical difference between C# using statements and using declarations: how scope affects when Dispose is called, when to choose each form, and common pitfalls.
C# Using Declaration: Syntax, Scope, and Disposal
c# using declaration: Learn how the C# using declaration works, its scope and disposal behavior, and how it compares to the classic using statement.
C# Using Statement: Dispose Resources Reliably
c# using statement: Learn how the C# using statement guarantees IDisposable.Dispose is called, with syntax, examples, and common pitfalls.
Implementing the C# Dispose Method Correctly
Learn how to implement the C# Dispose method correctly with the standard IDisposable pattern, use the using statement and using declaration, and avoid common resource-management mistakes.
C# IDisposable: The Dispose Pattern Explained
c# idisposable: Learn how to implement IDisposable correctly in C#, use the using statement, and avoid common resource leaks.
Implementing the C# Dispose Pattern
Learn how to implement the C# dispose pattern correctly, covering IDisposable, finalizers, using statements, async disposal, and common failure modes.
Using C# SemaphoreSlim to Limit Concurrent Access
Learn how C# SemaphoreSlim limits concurrent access to shared resources, with async waiting, cancellation, and practical throttling examples.
C# ConcurrentStack: Thread-Safe LIFO Collection
Learn how to use C# ConcurrentStack for thread-safe LIFO operations: Push, TryPop, TryPeek, bulk methods, and the performance tradeoffs to consider.
Using C# ConcurrentQueue for Thread-Safe FIFO Work
Understand how to use C# ConcurrentQueue<T> for thread-safe FIFO operations: core methods, enumeration, performance, and common pitfalls.
Using C# ConcurrentDictionary for Thread-Safe Collections
Learn how to use C# ConcurrentDictionary for thread-safe operations, including atomic methods, performance tradeoffs, and when to choose it over other approaches.