Leverage 'is not' Operator for Exception Filtering!
Did you know you can use the 'is not' operator with exception filtering to simplify and improve your error handling in C#?
In this short blog post, I will show you how to use it.
Hey, I'm Steven a .NET Developer in Switzerland. I am a Microsoft MVP. Also, this blog is open source on GitHub.
Did you know you can use the 'is not' operator with exception filtering to simplify and improve your error handling in C#?
In this short blog post, I will show you how to use it.
In this blog post, we will discuss how we can "cache" entries from the database. We will talk about why we would do this in the first place and how to achieve that.
Also, we will talk about some implications and what "cache invalidation" is.
Sometimes you have to map an object to another representation in C#. And you think: Why isn't C# duck-typing capable?
You might hear of libraries like AutoMapper that do the tedious work of mapping one object to another with the same structure. This blog post will give a super simple introduction to how those libraries are working internally.
In the end a bit of a subjective topic on whether or not I would use such libraries.
Skip and Take are used for pagination or limit the number of elements returned by a query.
Since C# 8 you can use Take with a Range. Let's see some examples.
In this blog post we will discover how to write your own small task scheduler / job scheduler with cron notation in ASP.NET Core. You might know similar approaches under the name of Quartz or Hangfire.
With the help of BackgroundService we will build our own, lightweight version of it.
In recent months and years, there was a certain hype around benchmarking, also in the .NET community.
This blog post is meant to ground some of the benchmarking topics and put this into relation to other things so you get a better understanding if it's worth the effort.
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!
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.
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.
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.