Browse by Topic
Popular
Popular Posts
Latest
Latest Posts
C# Type Class: Emulating with Interfaces
C# Type Class: Learn how to emulate type classes in C# using interfaces, generic constraints, and static generic classes, with tradeoffs and decision criteria.
C# typeof vs GetType: Compile-Time vs Runtime Type Resolution
c# typeof vs gettype: Learn the difference between C#'s typeof operator and GetType() method, including compile-time vs runtime resolution, inheritance behavior, and p...
C# Reflection GetType: Inspect Runtime Types
Learn how to use C# reflection GetType to inspect runtime types, compare it with typeof, and avoid common pitfalls in real-world code.
C# Reflection: typeof in Practice
Learn how to use C#'s typeof operator with reflection: getting Type metadata, inspecting members, handling generics and nullable types, and caching reflection results for performance.
C# CallerLineNumber: Usage and Examples
Learn how to use the C# CallerLineNumber attribute to capture the exact source line of method calls for logging, debugging, and diagnostics.
Getting 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.