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

Older Posts

Preview image blogpost

Is a square a rectangle? Liskov substitution principle in action

I will put that simple question in the room: "Is a square a rectangle?" And you might thank: "Well dah, of course!"

But wait for a second and let's check it together. We will use the L in SOLID: The Liskov Substitution principle to check if this relationship makes sense for us!

Read the whole article

Preview image blogpost

The Humble Object Pattern

The Humble Object Pattern is a design pattern to make especially unit testing easier with the goal of separating behaviors that are easy to handle (domain logic) from behaviors that are hard to handle (like external events or dependencies).

So let's have a look at what it is and how you can utilize it.

Read the whole article

Preview image blogpost

Performance (ReadOnly)List vs Immutable collection types

A bit back on LinkedIn, there was a discussion about read-only collection and immutability where this is not the point I want to discuss now, as I already covered that here: "ReadOnlyCollection is not an immutable collection".

This post is just about the performance of those types compared to our baseline, the good old List<T>. It also explains why we see the results we see.

Read the whole article

Preview image blogpost

From Testing Pyramid to Diamond

In this article, we will discuss the testing pyramid - what it is and what are some problems with that.

We will also discuss a different approach: The testing diamond.

Read the whole article

Preview image blogpost

Getting git version information in your C# code

Did you ever need git-specific information like the latest tag or the current commit inside your C# code? Or even the semantic version number of your current build=

Well, there is an easy solution involving source generators.

Read the whole article

Preview image blogpost

error NETSDK1194: The "--output" option isn't supported when building a solution.

Did you see the following error in recent days in your build-pipeline:

error NETSDK1194: The "--output" option isn't supported when building a solution.

If so - that is not necessarily your fault at all! Microsoft released a new SDK version, which breaks your builds. Let's see why and what we can do to tackle that.

Read the whole article

Preview image blogpost

A (performance) quirk with JsonSerializer

System.Text.Json.JsonSerializer has a weird quirk in regard to performance and memory management. So we will discuss what is "wrong" with this code: JsonSerializer.Serialize(myObject, new JsonSerializerOptions(...));.

Read the whole article

Preview image blogpost

What is a Middleware and how to use it in ASP.NET Core?

Did you ever ask yourself: What is a middleware, and why should I use it?

If so, this blog post is exactly for you. We will see where we could use a middleware and also how we can use the Dependecy Injection container of ASP.NET Core.

Read the whole article

Preview image blogpost

Multi-Tenancy with RavenDB and ASP.NET Core

Multi-tenancy is a software architecture pattern where a single instance of a software application is used by multiple customers, with each customer having separate and isolated data, configurations, and resources. RavenDB is a NoSQL document database that provides a flexible and scalable solution for multi-tenant applications. This blog post will explore why multi-tenancy exists, the advantages of using RavenDB for multi-tenant applications, and provide code examples to get you started.

Read the whole article

Preview image blogpost

C# Language Mind map

This blog post contains a mind map of language features starting from C# 1 up til now - including some of the new C# 12 features that will be released in November 2023.

Read the whole article

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