RSSAmplifier

Blog

Steven Giesel

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

steven-giesel.comRSS feed ↗330 posts

Latest posts

.NET Toolbox August Update

Quite some time passed since I posted a changelog to the .NET Toolbox . And there are big news: The Toolbox is running dotnet native in the browser thanks to wasm and Mono!

.NET 11 Performance Edition

As always my yearly take on the latest .NET release. In a few months dotnet 11 will be released and I wanted to have a look into some performance metrics.

Adding static getter thanks to extensions

Here a simple scenario: You have a StringComparer and you want to add your own comparer to the mix - for example a "natural sort" order, so "file2" sorts before "file10" instead of after. With C# 14 we can extend the family and make it feel natural!

Set LogLevel of Blazor

Blazor is a bit talkative when it comes to the Developer Console. PageSpeed Insights for example does complain: Browser errors were logged to the console The fix is easy.

LinkedIn - What a dumbster fire

LinkedIn: The "professional" network where critical thinking takes a backseat and everyone is an expert in everything.

Signals in Blazor

Signals - more often used in Angular - are a nice way to tell the UI that something has changed. Blazor doesn't have that natively, but how would it look, if it did?

EF Core 11 makes your split queries faster

If you use AsSplitQuery anywhere in your codebase, EF Core 11 has a present for you: your queries get faster.

Zstandard compression in .NET 11

.NET has had DeflateStream , GZipStream , ZLibStream , and BrotliStream for a while now. In .NET 11, a new one joins the party: ZstandardStream . And now we get to say "Zstd" in .NET.

BackgroundService exceptions now propagate in .NET 11

Here's a bug that lived in .NET for over four years As in: Reported over 4 years ago . If your BackgroundService threw an exception after its first await , your host would catch it, log a critical message, and then exit cleanly with exit code 0 . So everyone would think it terminated successfully. That got fixed!

ConfigurationIgnoreAttribute in .NET 11

Microsoft.Extensions.Configuration has had ConfigurationKeyNameAttribute since .NET 6 which it lets you rename the key a property maps to. But there was never an official way to say "don't bind this property at all." That gap is finally closed in .NET 11 with ConfigurationIgnoreAttribute .

Source code generated string enums with exhaustion support

Some time ago (over 4.5 years ago!) I wrote a blog post titled: "A better enumeration - Type safe from start to end" . While cool and so - it had some issues. Let's tackle them!

records ToString and inheritence

What is the output of that code snippet? Console.Write(new Derived("Test")); public abstract record Base(string Key) { public override string ToString() => Key; } public sealed record DerivedRecord(string Key) : Base(Key); Probably "Test" ?

FullJoin in .NET 11 - potentially

We have Join . We have LeftJoin . We have RightJoin . But somehow we still don't have a proper full outer join in LINQ. That might come soon!

Tool-Highlight: Handy

I am using a tool called Handy, which is basically nothing else than speech to text. But it does it so well that I thought, okay, let's give it some broader audience.

Being stupid is fun: Let's create long exception messages!

Sometimes doing arbitrary stuff feels just good! So let's do that!

New runtime async is hitting .NET 11 - Part 1

Some time back I wrote about "async2 - The .NET Runtime Async experiment concludes" basically moving the async state machine into the runtime. Now with .NET 11 we are seeing the fruits of that labor.

Collection Expression Arguments in C# 15 are "out"

The first preview of .NET 11 and C# 15 did just release. Some weeks back I did add already an article about that: "Collection Expression Arguments in C# 15+" . Well quicker than anticipated that feature is now part of it!

.NET Toolbox February Update

In Dezember 2025 and January 26 I created a small helper tool: the .NET Toolbox . I also made a post about, if you wanna be "up to speed": ".NET Toolbox" . I did some bug fixes and updates.

Sometimes you just need extensions methods to model your stuff

I came across a recent thing, where I hit the limit with the "normal" approach of modeling my entity and had to resort to extension methods.

Collection Expression Arguments in C# 15+

There is a nice proposal which would make collection expressions a bit better - Giving the users the ability to pass in arguments to the creation.

.NET Toolbox

Let's start the new year with a bang: I created a new tool called "Toolbox" to offer some helpful tools for your everyday .NET life. Totally free, open-source and everything client-side!

Task.Delay fails if you wait longer than 49.7 days

Task.Delay fails if you wait longer than 49.7 days. So something like: await Task.Delay(TimeSpan.FromDays(50)); will fail. But why and should you care?

One Minute Knowledge: Is ToArrayAsync or ToListAsync faster for Entity Framework?

Short question, and a short answer: ToListAsync - but why?

GitHub Runners might not be a good benchmark baseline

I saw mutliple places where people use GitHub runners to do some benchmarking. That can be a tricky thing to do.

Mime Type Helper in .NET 11

New helper will be available with .NET 11: MediaTypeMap.GetMediaType and MediaTypeMap.GetExtension which makes the web-development a bit easier!

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…

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!

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

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.

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.

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.

Use CancellationTokens

This is a very small blog post on why you should use CancellationToken s in your API.

LinkedIn Benchmarks again

Another day, another dollar. LinkedIn has the tips for you! Performance, performance! Let's get right into it.

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.

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.

Quick one: Difference between collection expressions and collection initializer

Did you ever wonder if there is a noticeable difference between: List<int> a = [1, 2, 3]; // And List<int> b = new() {1,2,3}; Let's find out:

Two more LINQ extensions in dotnet 10

The preview 6 of dotnet 10 brings two more functions: InfiniteSequence and Sequence .

How to not return all properties in SqlRaw

Entity Frameworks SqlRaw has a small, sometimes annoying limitation : The SQL query must return data for all properties of the entity type. Sometimes that isn't desireable, so let's overcome that super easy.

Disabling thread safety check in Entity Framework

In this blog post we will have a look into how to disable the thread safety check in Entity Framework. What are the implications of doing so and how to do it.

Using Architecture Tests for CancellationTokens and sealed classes

Architectural Unit tests are nice to constraint your system (like which parts of your application can access other parts of your application). This blog post is not about that - that is covered a lot in the internet. No, I want to show what I did in a recent project: Checking if all controllers do use CancellationToken and some other entities are sealed .

Why Lists are not lowered to a while loop

Some while ago I was explaining what "Lowering" is. And the interesting part is that List behaves differently like an array while also a List is backed by an array. But why?

ToListAsync is fast again in Entity Framework (kind of)

Last year I wrote an article about how ToListAsync was slow in Entity Framework titled: "Be careful with ToListAsync and ToArrayAsync in Entity Framework Core" . Things have evolved since then, so let's celebrate!

Adding test description for data-driven tests in xUnit

Often times, you find yourself in writing data-driven tests in xUnit (like Theory tests) and you want to add a description to each test case. Let's explore how to do that.

You can't use switch expressions in Blazor (sometimes)

Did you ever try to have a switch expression in Blazor? Yes, and did it go well? Sometimes not. Let's see why!

.NET 10 Performance Edition

As every year, the dotnet team adjusted the runtime and libraries to improve performance. So let's go over some of the highlights. I will link the corresponding blog post or GitHub issue for each item, so you can read more about it if you are interested. And of course: You will find the benchmarks at the end of the article.

How to get to know the latest dotnet features - the nerdy way

If you want to be up to date with dotnet development, you can obviously follow the official blogs from Microsoft and release notes. But what if you want to pick into the future or smaller details that aren't released or covered? Then let's go to GitHub!

Why is enumerating over List faster than IList?

If we have a List<T> and an IList<T> , enumerating over the List<T> is faster than enumerating over the IList<T> . Why is that?

Avoiding reflection in C# in way unsafer ways!

For good reasons, many folks don't want to use reflection . Since .NET 8, we have a better way of dealing with this in most of the cases (when known in advance). But we can go the opposite: Make it even unsafer for a tiny bit performance!

Writing new guards with extensions in C# 14

In C# we have many nice guards sitting on top of static exceptions classes like ArgumentNullException , ArgumentOutOfRangeException , etc: As ArgumentException.ThrowIfNullOrEmpty , ArgumentException.ThrowIfNullOrWhiteSpace . Now we can extend them easily!

Clearing NuGet Caches

NuGet can cache a lot of packages and other stuffs over time. Here a small rundown on how to clear the biggest chunk.