
How to use (and test) TimeProvider timers in .NET
Testing timers in C# is difficult, but .NET 8 (C# 12) adds an abstract TimeProvider class that makes it easier. Let’s take a closer look.
Testing timers in C# is difficult, but .NET 8 (C# 12) adds an abstract TimeProvider class that makes it easier. Let’s take a closer look.
Testing time in C# is difficult, but .NET 8 (C# 12) adds an abstract TimeProvider class that makes it easier. Let’s take a closer look.
A look at if/else, switch/case, pattern matching, other options … and which is best. (spoiler: none ;) )
C# has been getting a lot of pattern matching love in recent years, like with list patterns in C# 11. The problem is knowing where and how to use it.
Generic attributes increase the flexibility of a very early .NET feature. Let’s try using them and see how it keeps our code DRY.
When sending notifications in a WinForms app, a MessageBox is the only way to go… or is it? Let’s get creative and see what else we might do.
Writing async code whenever possible is great, but how do we do it when we’re stuck with legacy (and very synchronous) code?
It’s trivial to register a dependency in a .NET API, but it’s important to clarify a few terms that drastically change a dependency’s lifetime.
GUIDs are heavily used in the world of development, so let’s look at a few quick and easy ways to generate them whenever we need them.
When it comes to finding a bug in an app, few things beat a good trail of logs. And for writing those logs, few tools beat NLog in simplicity or flexibility. I rarely appreciate just how flexible it is though, so it’s worth spending a little time taking a closer look.