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 2 of 77C# Lambda Default Parameters: Syntax and Limits
Learn how to use default values in C# lambda expressions: C# 12 syntax, compile-time rules, call-site behavior, and workarounds for older versions.
C# Primary Constructors for Classes: Syntax and Usage
C# primary constructors for classes: syntax, parameter capture, dependency injection examples, and the limits to check before replacing a constructor.
C# Reflection: Get Attributes from Types and Members
Learn how to use C# reflection to retrieve custom attributes from types and members, including inheritance behavior and performance considerations.
C# IComparer: Custom Sorting with IComparer<T>
Learn IComparer<T> in C# with a working example: custom sort order for Array.Sort and List<T>.Sort, null-safe Compare rules, and reuse tips.
C# async/await and Task Relationship Explained
Understand how C# async, await, and Task fit together: how async methods return Task, when await suspends execution, and how exceptions propagate across the task boundary.
C# Object.Equals vs ReferenceEquals: Key Differences
Object.Equals and ReferenceEquals answer different questions in C#: value equality vs reference identity. Learn how each works, when to override Equals, and common pitfalls.
C# String Equals vs ==: What’s the Difference?
Understand the difference between == and Equals when comparing strings in C#, including reference equality, interning, and culture-sensitive comparisons.
C# List Find vs LINQ First: Which to Use
Compare List<T>.Find with LINQ First and FirstOrDefault in C#: syntax, behavior, performance, and when to use each.
C# Where vs Find: Choosing the Right Approach
Understand the differences between Where and Find in C#, including when each is appropriate for collection searches and how their behavior affects performance.
C# Select vs SelectMany: Key Differences
Understand the difference between C# LINQ Select and SelectMany. See code examples for one-to-one projection, flattening nested collections, and when to choose each method.