Pages

Topics

Tools

↑↓navigate↵openescclose

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

Latest C# guides

Diagram showing a sequence of data items being split into equal-sized chunks using the C# LINQ Chunk method
C#

C# LINQ Chunk: Split Sequences into Batches

Learn how to use the LINQ Chunk method in C# to split sequences into fixed-size batches, with practical examples and performance considerations.

LINQC#.NETBatching
Illustration of C# LINQ TakeWhile stopping a sequence when a condition fails.
C#

C# LINQ TakeWhile: Stop at First Failure

c# linq takewhile: Learn how C# LINQ TakeWhile returns elements until a condition fails, its difference from Where, and when to use it for early exit.

LINQTakeWhileC# CollectionsDeferred Execution
Illustration of a row of blocks where the leading gray blocks are skipped and the remaining blue blocks pass through, representing the C# LINQ SkipWhile operator.
C#

C# LINQ SkipWhile: Syntax and Behavior

C# LINQ SkipWhile skips leading elements until a predicate first returns false, then returns the rest. Learn its syntax, indexed overload, and common pitfalls.

LINQC#IEnumerableDeferred Execution
Illustration of a LINQ Take operation selecting the first few elements from a sequence, with a cursor stopping after the third item.
C#

C# LINQ Take: Syntax, Behavior, and Use Cases

Learn how to use the LINQ Take method in C#: syntax, deferred execution, edge cases, performance implications, and practical pagination examples.

LINQC#IEnumerableDeferred Execution
Illustration of the LINQ Skip method skipping the first elements of a sequence
C#

C# LINQ Skip: Usage, Behavior, and Edge Cases

Learn how the LINQ Skip method works in C#, including deferred execution, pagination with Take, and edge cases like skipping past the end of a sequence.

LINQC#IEnumerablePagination
Illustration of two overlapping sets with the exclusive region of the first set highlighted, representing the C# LINQ Except set difference operation.
C#

Using LINQ Except in C# to Find Set Differences

c# linq except: Learn how LINQ Except works in C#: default equality, custom comparers, duplicate handling, order preservation, and performance tradeoffs.

LINQC#Set OperationsIEnumerable
Diagram showing two overlapping circles with a highlighted intersection area, representing the LINQ Intersect operation in C#.
C#

C# LINQ Intersect: Set Intersection in Practice

Learn how to use C# LINQ Intersect to find common elements between collections, including custom equality comparers, performance behavior, and multiset alternatives.

LINQC#IntersectSet Operations
Diagram showing two overlapping sets merging into a single distinct set, illustrating the C# LINQ Union operation.
C#

C# LINQ Union: Merging Sequences Without Duplicates

Learn how C# LINQ Union merges two sequences without duplicates, how it differs from Concat, and how to control equality for custom types.

LINQC#.NETSet Operations
Illustration of two sequences merging into one using the LINQ Concat method, with C# code snippet in the background.
C#

C# LINQ Concat: Syntax and Use Cases

C# LINQ Concat: Learn how to merge two sequences, understand lazy evaluation, and see practical examples with arrays and lists.

LINQC#collectionssequence concatenation
Illustration of C# LINQ GroupJoin connecting departments to employee lists showing nested grouping
C#

C# LINQ GroupJoin Syntax and Use Cases

c# linq groupjoin: Understand how C# LINQ GroupJoin pairs parent and child collections, produces nested child sequences, and differs from a standard join.

LINQC#GroupJoinData Joining