Make settings required
class MySettings
{
[Required]
public string DbConnectionString { get; }
[Required]
public MySecrets Secrets { get; }
}
class MySecrets
{
public string ApiKey { get; }
public string Login { get; }
public string Password { get; }
}provider.Get<MySettings>(); // will throw if DbConnectionString or Secrets are not initialized Changing defaults
Related pages
Obtain settings from providerObserve settings via providerBinding nodes to modelsLast updated
Was this helpful?