All posts with Tag C# 14

Preview image blogpost

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!

Read the whole article

Preview image blogpost

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!

Read the whole article

Preview image blogpost

Extensions get an update in .NET 10

With the latest preview: .NET 10 preview 3, we did get an overhaul on extensions. It might enable some nice tricks in the future.

Read the whole article

Preview image blogpost

C# 14: Null-conditional assignment

The preview 1 of dotnet 10, and therefore the next iteration of the C# language, is right in front of our doorsteps. So let's have a look at one of the first potential additions to the language: Null-conditional assignment.

Read the whole article

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