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

Marking API's as obsolete or as experimental

Often times your API in your program or library evolves. So you will need a mechanism of telling that a specific API (an interface or just a simple method call) is obsolete and might be not there anymore in the next major version.

Also it can happen that you have a preview version of a API, which might not be rock-stable and the API-surface might change. How do we indicate that to the user?

Read the whole article

Preview image blogpost

Infographics Compendium III - Exceptions, EF Sanitized, Operators, ...

This edition has the following infographics:

  • DebuggerDisplayAttribute
  • Entity Framework input and LINQ - is it safe?
  • ExceptionDispatchInfo
  • implicit and explicit operator

Read the whole article

Preview image blogpost

local functions vs lambda expressions

.NET knows local functions and lambda expressions. You can almost take them interchangeably, but there are also some differences between them.

This article will show the differences between them.

Read the whole article

Preview image blogpost

Throwing exceptions - Why is my stack trace lost?

You might have read, that re-throwing an exception like this: throw exc; is considered bad practice and you should just do this: throw; instead.

But why is it like that?

Read the whole article

Preview image blogpost

LiteDB - A .NET embedded NoSQL database

In this article we will have a closer look at LiteDB, a .NET NoSQL Document Store in a single data file. We will discover the advantages of LiteDB and why it is a viable candidate for your next project.

We will also explore what are the differences between a NoSQL and a classical SQL database are and what this has to do with the reminiscent SQL CE or the more modern SQLite database.

Read the whole article

Preview image blogpost

Cursed C# - Doing shenanigans in C#

In this short blog post I want to show you two silly things so that you can apply right now! Both of them equally silly, but that is not the point (is it ever?).

We will see how to await an integer or TimeSpan and how to foreach through an integer. All of this thanks to the magic of extensions methods.

Read the whole article

Preview image blogpost

Infographics Compendium II - ThrowHelper, null Task and more

This edition has the following infographics:

  • ConfigureAwait on IAsyncDisposable
  • Index in foreach
  • Non-destructive mutations with struct
  • Returning null for a Task
  • Throw-Helper
  • verbatim strings

Read the whole article

Preview image blogpost

Low-level struct improvements in C# 11

C# 11 brings some major improvements for structs. You remember Span<T>, which you couldn't create?

Now you can. C# 11 allows ref fields in a struct. Why this is a cool thing and what you can do with it, you will see in a minute.

Read the whole article

Preview image blogpost

How does the key exchange in HTTPS work?

In this small blog post we will have a look at how HTTPS works. Well, we will look how the cryptographic part works a bit more in detail.

The focus is on the Diffie Hellman Key algorithm, an asymmetric key exchange.

Read the whole article

Preview image blogpost

Introduction to WebApplicationFactory

This article will show you what exactly a WebApplicationFactory is and why it is so "mighty" when it comes down to testing. I will highlight some of the properties, which you can leverage to write powerful tests.

Read the whole article

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