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

Older Posts

Preview image blogpost

Delegate, Action, Func, Lambda expression - What the heck!?

C# offers a lot of utility especially around the delegate topic. So let's see what exactly a delegate is and how the distinct types like delegate, Action, Func, Predicate, anonymous function, lambda expressions and MulticastDelegate behave. A lot to digest and discover so let's go.

Read the whole article

Preview image blogpost

The garbage collector in .NET - Part 2: Compacting

I already made a post about how the Garbage Collector works in .NET and also introduced the topic of Generation slightly. This article will look a bit more in detail into why we have those mechanisms in the first place, including the Large Object Heap.

Read the whole article

Preview image blogpost

ObjectPool - Rent and return some instances

Just imagine a car pool: There is a dealer which bought the car and lent's it to you. After a while you will return this car where you got it from. Much like that works an ObjectPool in C#. You can rent an expensive object from the pool and when you are done with it, you just return it. Sounds beautiful, doesn't it?

Let's explore the advantages and disadvantages of a ObjectPools and how they work.

Read the whole article

Preview image blogpost

Blazor with an RSS Feed

If you use a public Blazor Server application (like this blog is) and you want to expose an RSS Feed (I know kind of old school) you can perfectly do that with Blazor Server and a little help from a nuget package from Microsoft. Furthermore this guide is not only valid for Blazor but every ASP.NET Core endpoint.

Read the whole article

Preview image blogpost

How to unit test a RavenDB

RavenDB is a well known open-source document-oriented databse for .NET. And of course we want to test our logic and not only locally while developing, but also our continuous integration pipeline should be able to run our tests. So let's tackle exactly that.

Read the whole article

Preview image blogpost

The garbage collector in .NET

This article will talk about the garbage collector in .NET. Why do we have and need him? And why it is essential to understand the behavior to know what impact on our application he has.

Read the whole article

Preview image blogpost

Blazor with CancellationToken support

What happens when a user navigates away and still has a pending request to our server? Or what happens if we have a request which might take forever and wastes our resources?

Let's tackle these problems with a CancellationToken.

Read the whole article

Preview image blogpost

Stop using Finalizers in C#

Finalizers (historically referred to as destructors) are in C# since its dawn of time and are used to cleanup resources. But they should not used in every use-case and can harm your applications performance.

Read the whole article

Preview image blogpost

Tail-Recursion - Explained with the Fibonacci series

What is Tail-Recursion? We will discover this "special" form of recursion on the example of the Fibonacci series. Also we will check how much faster it is and why.

Read the whole article

Preview image blogpost

Why are sealed classes faster in C#? And should I seal them?

In C# we can add the sealed modifier to a class to indicate that no one is allowed to derive / inherit from that class. Let's have a look at the compiler in certain scenarios what happens if you seal a class.

Read the whole article

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