Hey, I'm Steven a .NET Developer in Switzerland. I am a Microsoft MVP. Also, this blog is open source on GitHub.

Recent Posts

Preview image blogpost
  • 11/24/2025
  • 1 minute read

Using sortable UUID / GUIDs in Entity Framework

.NET 9 introduced Guid.CreateVersion7() / Guid.CreateVersion7(DateTimeOffset) methods to create sortable UUIDs / GUIDs based on the time of their creation. This can be particularly useful in databases where you want to maintain a chronological order of records (plus some perf benefits). Currently, there is no native way to configure Entity Framework to use these methods when generating new GUIDs for primary keys. But we can do this on our own.

Read the whole article

Preview image blogpost

No more public partial class Program in .NET 10

If you are using API Tests with the WebApplicationFactory you might did something like this to have a public Program class:

public partial class Program;

No more!

Read the whole article

Preview image blogpost
  • 11/10/2025
  • 1 minute read

Capturing Console Output in xUnit.v3

In xUnit v2 ITraceOutputHelper was needed (and injected) to make the console output inside your production code visible inside a test - in v3 it is easier: CaptureConsoleAttribute

Read the whole article

Preview image blogpost

ArrayPool Benchmarks: We have a problem

Many benchmarks that are using ArrayPool, or more specificly ArryPool<T>.Shared, are not actually measuring a "real" scenarion or the benchmark is flawed in some way. Let's examine a bit on what is going on.

Read the whole article

Preview image blogpost

LinkedIn: "Are you still using new Random() everywhere?"

You need some advice around Random? Sure there is something on LinkedIn for that. Let's have a look.

Read the whole article

Preview image blogpost

Inlining and structs in C#

In this - somewhat technical and barely usable - blog post, we will have a look at inlining and structs in C#. And how they can optimize performance in some interesting ways.

Read the whole article

Preview image blogpost

ToDictionaryAsync retrieves the whole object from the database in Entity Framework

In Entity Framework Core ToDictionaryAsync (and of course) also the the synchronous counter part ToDictionary retrieve the whole object from the database.

Read the whole article

Preview image blogpost

Divide and Conquer the Database

For a lack of a better title, this blog post shows a database improvement that helped me quite a bit and what to do to make it work.

Read the whole article

An error has occurred. This application may no longer respond until reloaded.Reload x