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

Using SSE in C# on the example of the sum of a list

SSE stands for Streaming SIMD Extensions. What does that exactly mean and how can we leverage that in our C# code?

This blog post will shed some light on this topic. Also we make a small comparison to PLINQ.

Read the whole article

Preview image blogpost

Decorator Pattern using the example of a cached repository

The decorator pattern is a common pattern in object oriented languages. It allows us to add behavior to an individual object without changing the object itself.

We will exactly that with a repository. We introduce a caching layer via the decorator pattern.

Read the whole article

Preview image blogpost

RequiredIf - Extend the validation in Blazor

Just imagine you have your beautiful model in a form. And Blazor is very kind and does validation for you. It is really straight forward because you can annotate your model with some attributes like RequiredAttribute to tell Blazor: "Hey this property has to be set, otherwise the form will not be submitted."

But what if you want to have that easy setup with attributes but also want to say to Blazor: "Hey this property has to be set, if the other property is true.* Well, that does not work out of the box. So let's make it together!

Read the whole article

Preview image blogpost

Directory.Build.props - Centralize your builds

MSBuild has several extensibility hooks to customize your build and today we discover one which let you centralized repeating aspects of your C# projects. Directory.Build.props

Read the whole article

Preview image blogpost

DebuggerTypeProxy - Displaying complex states in the debugger

With the DebuggerTypeProxy we have the possibility to show more complex states. This can be helpful in certain cases where an object for example has a lot of properties.

Read the whole article

Preview image blogpost

Blazor Performance Tuning - Good practices and advanced use cases

Blazor is a beautiful framework for building SPA's. One advantage is that those SPA's feel like native applications. We do not feel that stuff is necessarily loading. But for that we have to keep our code performant.

This guide will highlight some of the techniques to keep your Blazor app running smoothly. We will also cover some more advanced use cases.

Read the whole article

Heap, Stack, Boxing and Unboxing, Performance ... let's order things!

In this article I will shade some lights on some of the most used terms which seems very confusing especially for beginners: heap, stack and boxing and unboxing.

Furthermore we will also encounter internet wisdom like:

Value types get stored on the stack. Reference types on the heap

We discuss why this is wrong and what the hell performance has to do with it?

Read the whole article

Preview image blogpost

Prerendering Blazor Apps - How does it work / tips and tricks

Blazor comes with the option to prerender your webpage on the server. This works for the client-side version as well as the server side version of Blazor.

Let's have a look how does it work and what might be some pitfalls and how can we come around those.

Read the whole article

Preview image blogpost

Enum.Equals - Performance analysis

Did you know that you can spend 100x times longer depending how you compare your enums?

Of course we are speaking here in terms of nanoseconds but this story is much more then just numbers. We'll also talk about boxing and unboxing. So let's dive right into it.

Read the whole article

Preview image blogpost

Lazy load components with Blazor - Virtualize in Action

Since .NET5 we have the ability to "virtualize" a component.

But what exactly is that and how do we use it? This blog post will show you a lot of details about the <Virtualize> tag.

Read the whole article

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