ISettings<TSettingsClass,TSettingsInterface> Interface
Defines a strongly-typed settings contract that can be read from an Microsoft.Extensions.Configuration.IConfiguration section.
public interface ISettings<TSettingsClass,TSettingsInterface> where TSettingsClass : class, TSettingsInterface, HAKOM.Configuration.Core.Net.Api.ISettings<TSettingsClass, TSettingsInterface> where TSettingsInterface : classType parameters
Section titled “Type parameters”TSettingsClass
The concrete class that implements both TSettingsInterface and this interface. Must be a reference type.
TSettingsInterface
The public interface that consumers depend on for reading settings values. Must be a reference type.
Remarks
Section titled “Remarks”Implementors must provide three static abstract members: Key (the configuration section path), TryRead(IConfiguration) (validation and binding), and Defaults (fallback values when no configuration is present).
Properties
Section titled “Properties”ISettings<TSettingsClass,TSettingsInterface>.Defaults Property
Section titled “ISettings<TSettingsClass,TSettingsInterface>.Defaults Property”Gets the default settings values used when the configuration section identified by Key is not present.
static abstract TSettingsInterface Defaults { get; }Property Value
Section titled “Property Value”ISettings<TSettingsClass,TSettingsInterface>.Key Property
Section titled “ISettings<TSettingsClass,TSettingsInterface>.Key Property”Gets the configuration section key used to locate these settings within an Microsoft.Extensions.Configuration.IConfiguration hierarchy.
static abstract string Key { get; }Property Value
Section titled “Property Value”ISettings<TSettingsClass,TSettingsInterface>.Value Property
Section titled “ISettings<TSettingsClass,TSettingsInterface>.Value Property”Gets this instance cast to TSettingsInterface.
TSettingsInterface Value { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”ISettings<TSettingsClass,TSettingsInterface>.TryRead(IConfiguration) Method
Section titled “ISettings<TSettingsClass,TSettingsInterface>.TryRead(IConfiguration) Method”Attempts to read and validate the settings from the given configuration.
static abstract HAKOM.ErrorHandling.Core.Net.Api.Result<TSettingsInterface> TryRead(Microsoft.Extensions.Configuration.IConfiguration configuration);Parameters
Section titled “Parameters”configuration Microsoft.Extensions.Configuration.IConfiguration
The configuration root or section to bind from.
Returns
Section titled “Returns”HAKOM.ErrorHandling.Core.Net.Api.Result<TSettingsInterface>
A Result<TValue> containing the bound
TSettingsInterface on success, or an error on failure.