Configure Method
Definition
Configure<TOptions>(Action<TOptions>, Action<TOptions>, Action<TOptions>)
Returns the default parameter-less constructed instance of TOptions configured with setup delegate.
public static TOptions Configure<TOptions>(Action<TOptions> setup, Action<TOptions> initializer = null, Action<TOptions> validator = null) where TOptions : class, IParameterObject, new()
Parameters
setupAction<TOptions>The delegate that will configure the public read-write properties of
TOptions.initializerAction<TOptions>The optional delegate that will initialize the default parameter-less constructed instance of
TOptions. Should only be used with third party libraries or for validation purposes.validatorAction<TOptions>The optional delegate that will validate the
TOptionsconfigured by thesetupdelegate.
Returns
- TOptions
A default constructed instance of
TOptionsinitialized with the options ofsetup.
Type Parameters
TOptionsThe type of the configuration options class having a default constructor.
Remarks
Often referred to as part the Options pattern: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options