.NET / C#

.NET / C#

I love programming in .NET / C#. Have been doing it since 2004 now. Much has changed since: the .Net framework is got more libraries, NuGet was a game-changer and even C# itself is evolving with lambda and dynamic.

And now .Net has evolved to Standard and Core with support for other platforms like Linux / Docker. Things are getting easier and faster.

Dependency Injection based on request headers
Dependency Injection based on request headers
.NET Core / C#, Dependency Injection

Dependency Injection based on request headers

Dependency Injection (DI) helps us to change the behavior of parts of our program on the fly. This is especially neat when you want to test your domain services against a mocked data-store. But what if you need to change the behavior of your API based on a request header?

Yesterday I had a discussion with my colleague Robert Kranenburg about this. He showed an example of a console application changing its behavior based on an argument. I took the idea and converted it into .NET Core 3.1 code to change behavior based on a cookie.

Building a high performing last viewed list using Redis
Building a high performing last viewed list using Redis
.NET Core / C#, Redis

Building a high performing last viewed list using Redis

We live in a day and age in which we can choose a data-store that matches the characteristics of our apps and (micro) services. Lately we’ve been looking into Redis as a high performing store for last viewed items. In this blog I’ll look show how to create a POC with the redis-cli and then implement it using .NET Core. We’ll be using the sorted set structure.