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 15 of 77C# Discard Pattern: Syntax and Practical Use Cases
Learn how to use C# discards with out parameters, deconstruction, and pattern matching, plus common pitfalls to avoid.
C# var Pattern: Syntax, Use Cases, and Pitfalls
c# var pattern: Learn how the C# var pattern works, where it fits in pattern matching, and when it's useful versus other patterns.
C# Iterator Deferred Execution
In C#, iterator methods that use yield return defer execution until enumeration. This article covers state-machine behavior, exception timing, side effects, and when to materialize a sequence.
Understanding IEnumerator in C#
c# ienumerator: Learn how IEnumerator powers foreach in C#, how to implement custom enumerators manually or with yield, and the performance tradeoffs to consider.
C# IEnumerable: How It Works and When to Use It
C# IEnumerable: Learn how IEnumerable<T> works, including deferred execution, yield return, and when to choose it over List or IQueryable.
C# Yield Break: How to End Iterator Methods
Learn how yield break terminates a C# iterator method, its behavior, and when to use it for early exit in lazy sequences.
C# yield return: Lazy Iteration Explained
Learn how C# yield return creates lazy iterators, when to use it, and how it affects memory and execution.
C# LINQ Immediate Execution: When and How to Force It
Understand when C# LINQ queries actually run, how ToList, ToArray, and aggregate methods force immediate execution, and what that means for performance and correctness.
Using c# eventargs for Custom Event Data
Learn how to use c# eventargs to pass data in events, create custom event argument classes, and follow best practices for .NET event design.
Reading and Preserving C# Exception Stack Traces
Learn how to read, log, and preserve C# exception stack traces, handle async stack traces, and understand the role of PDB files.