Optimal usage of Global Usings

I have a solution with ~40 projects, built during many years with wild usings that I wanted to clean up. The global usings feature, introduced in with C# 10.0 and .NET 6 (nov21) to simplify and reduce the repetition of commonly used namespaces throughout a project.

The question I have is, how do I ‘get’ the most commonly used namespaces and how do I do that at scale.

Continue reading “Optimal usage of Global Usings”

Value Objects in C# – Part 2

2. Choosing the property modifiers

Property setters in C# play a crucial role in defining how you can interact with class and record members. The set, init, and get-only accessors offer different levels of mutability and initialization control, crucial for both mutable and immutable object design. There are a couple of options out there, which one to choose?

Continue reading “Value Objects in C# – Part 2”