Browse by Topic

Popular

Latest

Latest C# Posts

Illustration of C# file access modifier controlling visibility within a source file
C#

C# File Access Modifier: Syntax and Use Cases

Understand how the C# file access modifier restricts a top-level type to its source file, with syntax examples and comparisons to internal, public, and private.

Access ModifiersC# ProgrammingFile I/OClass Design
Illustration of a C# file class icon with a document and gear, representing file operations.
C#

C# File Class: Static File Operations Explained

A practical guide to the C# File class: reading and writing files, using streams and async methods, handling errors, and choosing between File and FileInfo.

C#File IOSystem.IOStreamReader
Illustration of a C# constructor marked with SetsRequiredMembers attribute ensuring required members are initialized.
C#

C# SetsRequiredMembers: Constructor Initialization

Learn how the C# SetsRequiredMembers attribute marks constructors that initialize all required members and when to use it.

C#Required MembersConstructorCompiler Attributes
Comparison of C# required and init modifiers showing compile-time enforcement and immutability
C#

C# Required vs Init: Key Differences

C# required and init solve different initialization problems. Learn how they work, how to combine them for immutable objects, and when to choose each pattern.

C#required modifierinit accessorobject initialization
Diagram showing primary constructor parameters being assigned to class fields in C#
C#

C# Primary Constructor Field Access: Storing Parameters

c# primary constructor field access: Learn how to access and store primary constructor parameters as fields in C# 12, including common pitfalls and best practices.

primary constructorsC# 12field accessclass design
Diagram showing a derived class primary constructor passing parameters to a base class primary constructor
C#

C# Primary Constructor Inheritance Explained

Learn how C# primary constructors behave with inheritance: passing parameters to a base class, capturing values, and planning around key limitations.

C# 12Primary ConstructorsInheritanceObject-Oriented Programming
Illustration of a C# struct with primary constructor parameters mapping to fields.
C#

C# Primary Constructor Struct: Syntax and Behavior

c# primary constructor struct: Understand C# primary constructor struct syntax, how parameters map to fields, and when to use them.

C#StructsPrimary ConstructorsC# 12
Illustration of a C# expression tree with nodes branching into a compiled delegate arrow
C#

C# Expression Tree Internals: How Code Becomes Data

Explore how C# expression trees represent code as data, how Compile() produces delegates, and when to use them in production.

expression treesLINQExpressionVisitorreflection
Illustration of a C# expression tree being compiled into an executable delegate, shown as a tree structure transforming into a callable function node.
C#

Compiling C# Expression Trees into Executable Delegates

Learn how C# Expression.Compile() converts expression trees into executable delegates, when to use it, and how to avoid repeated compilation costs.

Expression TreesDelegatesRuntime CompilationLINQ
A visual comparison between C# Expression trees and Func delegates, showing code as data versus executable code.
C#

C# Expression vs Func: When to Use Each

Understand the difference between C# delegates and expression trees, when to use each, and how they affect LINQ and dynamic query building.

Expression TreesDelegatesLINQFunc