June 10, 2020

Testing IOptionsMonitor

IOptionsMonitor is a feature of the .NET Core Configuration system that provides access to configuration options, even if they change at runtime. This post looks at how to test code that uses IOptionsMonitor.

May 18, 2020

Binding and Validating Enums in ASP.NET Core

We commonly use C# Enumeration types to represent a set of named constants within our applications. Often the values for such properties comes from the user via an API request but unfortunately the default model-binding and validation behavior in ASP.NET Core does provide the desired API experience. This post looks at how we handle binding and validating enum values in our APIs as well as supporting snake_case variants of the enum member names.

© 2020 Ben Foster