C# 11 introduced a new feature -static virtual members in interfaces. The primary motivation for this feature is to support generic math algorithms. The mention of math might make some ignore this feature, but it turns out it can be useful in other scenarios.For example, I was able to leverage this feature to clean up how I register and consume custom config section types.Custom Config SectionAs a refresher, let’s look at custom config sections. Suppose you want to configure an API client in yourappSettings.json. You can map the config section to a type. For example, here is anappSettings.json
...
继续阅读
(94)