Browse by Topic
Popular
Popular Posts
Latest
Latest C# Posts
C# Collection Initializer vs Object Initializer
c# collection initializer vs object initializer: Understand the difference between C# collection initializers and object initializers, how the compiler translates each...
C# InterceptsLocation Attribute Usage
Learn how to use C# InterceptsLocationAttribute with source generators to redirect method calls at compile time, including syntax, limitations, and debugging tips.
Implementing C# Interceptors with a Minimal Example
C# interceptors let a method replace calls at specific source locations during compilation. This article shows a minimal source generator, how the compiler resolves intercepted calls, and when the preview feature is practical.
C# Lambda Explicit Return Type
c# lambda explicit return type: Learn when and how to specify an explicit return type for a C# lambda expression, including syntax, limitations, and practical examples.
C# Lambda Ref Parameter: Why It's Not Allowed
c# lambda ref parameter: Learn why C# lambda expressions cannot declare ref parameters and how to use local functions or wrapper types to achieve pass-by-reference beh...
C# Lambda Params: Syntax and Common Pitfalls
Learn how to define lambda parameters in C#, including implicit and explicit types, multiple parameters, and working with params arrays through delegates.
C# Using Alias for Generic Types
Learn how C# using aliases shorten closed generic type names, why open generic types cannot be aliased, and when a wrapper class may be a better fit.
C# Using Alias for Tuple Types
c# using alias tuple: Learn how to use the C# using alias directive with tuple types to shorten repetitive type signatures and improve code readability.
C# Alias Any Type with Using Directives
c# alias any type: Learn how to use C# 12's using alias directive to create aliases for any type, including tuples, arrays, and pointers, with practical examples and s...
C# File Local Type: Scoped Type Declarations
C# file-local types restrict type visibility to a single source file. Learn how they work, when to use them, and which constraints apply.