Sponsored by Nick Chapsas—Want to learn how to build elegant REST APIs in .NET? Get 5% off Nick's latest course "From Zero to Hero: REST APIs in .NET"!
My new book ASP.NET Core in Action, Third Edition is available now! It supports .NET 7.0, and is available as an eBook or paperback.
Behind [LogProperties] and the new telemetry logging source generator
In this post I look at the new Microsoft.Extensions.Telemetry.Abstractions logging source generator, the generated code, and the [LogProperties] attribute…
A failed experiment with interceptors in C# 12 and .NET 8
In this post I described how I tried (and failed) to add an interceptor for Enum.ToString(), due to a bug in the Roslyn compiler.…
Replacing method calls with Interceptors
Exploring the .NET 8 preview - Part 5
In this post I look at the C#12 feature, interceptors. I show how and why they're useful, and how the ASP.NET Core minimal API source generator uses them…
Fighting with nullable reference types in Razor Pages
In this post I discuss C#'s nullable reference types in the context of Razor Pages, why they don't play nicely together and how to improve the experience.…
Counting the leading zeroes in a binary number with C#
In this post I describe an algorithm to count the number of leading zeroes in a ulong, study how it works, and benchmark it against alternatives.…in C#
Working with System.Random and threads safely in .NET Core and .NET Framework
In this post I look at some of the ways you can misuse System.Random, comparing .NET Framework, NET Core, and .NET 6 implementations.…in C#