RSSAmplifier

Steve Dunn · Mar 5, 2022

Implementing a defaultable collection in C#

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

This quick blog post shows one solution to a problem that you might have when binding to configuration ( appsettings.json or similar) in your .NET app. The problem: # I want to bind a collection from config, but if the config doesn't exist, I want to use some default values. I want either what's in config, or the default values, but not both For instance, given this type: public class…

Read on dunnhq.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.