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 25 of 77Using the C# Constant Pattern in Switch Expressions
Learn how the C# constant pattern works in switch expressions and statements, including syntax, matching rules, and practical use cases.
C# Type Pattern: Syntax and Usage
Learn how to use the C# type pattern with is expressions and switch statements for type testing and property matching.
C# Pattern Matching: Syntax and Practical Use
c# pattern matching: Explore C# pattern matching with practical examples: type, property, and positional patterns, switch expressions, and when to use them effectively.
Creating a C# Custom Iterator with yield
c# custom iterator: Learn how to build a C# custom iterator using yield return, when it's useful, and how it affects performance and memory.
IEnumerable vs IEnumerator in C#: Key Differences
Understand how IEnumerable and IEnumerator work in C#, how foreach uses both interfaces, and when to implement each interface directly.
C# Iterator: How yield return Works
Understand how C# iterators work with yield return, including deferred execution, the generated state machine, and practical performance considerations.
C# Property vs Indexer: Key Differences and Usage
Understand the differences between C# properties and indexers, including syntax, use cases, and when to choose each for clean, maintainable code.
C# Multiple Parameter Indexer: Syntax and Use
C# indexers can take multiple parameters to expose natural syntax such as `matrix[row, column]`. This article covers declaration syntax, overloads, composite keys, and common pitfalls.
C# Indexer get and set: Syntax and Usage
Learn how to implement C# indexers with get and set accessors, including syntax, validation logic, overloading, and performance considerations.
C# Indexers: Syntax, Usage, and Tradeoffs
Learn how to declare and use C# indexers with the `this` keyword, including syntax, overloads, read-only access, and practical tradeoffs.