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 19 of 77Getting the Caller File Path in C#
Learn how to use the CallerFilePath attribute in C# to capture the source file path of callers for logging, diagnostics, and debugging.
Using C# CallerMemberName to Avoid Hard-Coded Property Names
Learn to use the C# CallerMemberName attribute to capture caller names automatically, with practical examples for property change notifications and logging.
The C# Obsolete Attribute: Marking Deprecated Code
Learn how the C# Obsolete attribute marks deprecated APIs, triggers compiler warnings or errors, and supports API migration.
C# Conditional Attribute: How It Works and When to Use It
c# conditional attribute: Learn how the C# Conditional attribute controls method call inclusion at compile time, with practical examples and limitations.
How to Use C# Custom Attribute Classes
Learn how to define, apply, and read C# custom attribute classes, including AttributeUsage constraints and reflection-based retrieval.
C# Attribute Declaration Syntax and Usage
Learn the exact syntax for C# attribute declaration, including constructors, properties, targets, and retrieval via reflection.
C# Attributes: Syntax, Usage, and Runtime Behavior
C# attributes from the ground up: what the metadata holds, AttributeUsage targets, custom attribute classes, and reading values at runtime with reflection.
C# Params Multiple Arguments
Learn how the C# params keyword lets methods accept multiple arguments without explicit arrays, including syntax, overload resolution, null handling, allocation tradeoffs, and when to use collections instead.
Using C# params Span for Efficient Method Calls
Learn how to use C# params Span<T> to pass variable-length data with fewer heap allocations and better performance in high-throughput methods.
C# Params Array: Syntax and Usage
Learn how C# params array syntax works, when to use it, and how it affects method calls, overload resolution, and performance.