.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.

“Is One Of” and “Is Not One Of” validation attributes
“Is One Of” and “Is Not One Of” validation attributes
.NET Core / C#

“Is One Of” and “Is Not One Of” validation attributes

I love attribute validation! They can be used for a myriad of things. In .NET Core MVC we use them to validate models that come into our controllers. In one of our projects we kept running into the same thing: we need to validate a value against an array of pre-defined values. So we wrote some base validation attributes.

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.

Dictionary-style settings as IOptions
Dictionary-style settings as IOptions
.NET Core / C#, Dependency Injection, IOptions

Dictionary-style settings as IOptions

I love how we can use appsettings.json files to configure applications in the .NET Core platform. The JSON-format feels a lot less bloated than the old XML appSettings config I used to work with. In this blog I’ll explore how to load a dictionary-style settings class as an IOption. This can be very useful when working with dependency injection.

Dependency injection (with IOptions) in Console Apps in .NET Core
Dependency injection (with IOptions) in Console Apps in .NET Core
.NET Core / C#, Console Application, Dependency Injection, IOptions

Dependency injection (with IOptions) in Console Apps in .NET Core

When you are used to building web applications, you kind of get hooked to the ease of Dependency Injection (DI) and the way settings can be specified in a JSON file and accessed through DI (IOptions). It’s only logical to want the same feature is your Console app.