When it comes to C# types—classes, structs, and records—understanding the difference between value and reference equality is crucial. Each type behaves differently in terms of equality checks, inheritance, and how they manage their internal state. However, things can get tricky when you introduce interfaces into the mix, particularly when dealing with records.
Continue reading “Records and Interfaces: Here Be Dragons”Author: Wouter Van Ranst
Smart cleanup of unused references
Say you have a ‘large project’ (think: clean architecture) with 40+ projects that has gradually evolved over time, has been refactored etc. There may be unused references lying around.
Continue reading “Smart cleanup of unused references”Eagerly consuming a collection of completing Tasks
Imagine you start a bunch of files (say, uploading or downloading files big and small) and after the first one completes, you want to do something else — how do you await
that first task?
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”Adding a CorrelationId for Exceptions for Application Insights (DRAFT)
Admittedly, this title could be shorter, but it s also a bit of a niche topic.
Continue reading “Adding a CorrelationId for Exceptions for Application Insights (DRAFT)”Overriding Application Insights log levels
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?
Choosing a CosmosDB Consistency Level
For an elaborate explanation, see the official docs which contain this image, but without further explanation a bit enigmatic.

In this blog post we explore how you should pick the correct middle ground.
Continue reading “Choosing a CosmosDB Consistency Level”Value Objects in C# – Part 1
C# String Comparison Explained
When doing string comparisons, I always defaulted to StringComparison.InvariantCultureIgnoreCase
without giving it much further thought.
However, I recently had to explain what it actually did (and what it doesn’t) and I was a bit at a loss. This is what I found out.
Continue reading “C# String Comparison Explained”