OptionsServiceCollectionExtensions.AddOptions OptionsServiceCollectionExtensions.AddOptions OptionsServiceCollectionExtensions.AddOptions Method

Definition

Overloads

AddOptions(IServiceCollection) AddOptions(IServiceCollection) AddOptions(IServiceCollection)

Adds services required for using options.

AddOptions<TOptions>(IServiceCollection) AddOptions<TOptions>(IServiceCollection) AddOptions<TOptions>(IServiceCollection)

Gets an options builder that forwards Configure calls for the same TOptions to the underlying service collection.

AddOptions<TOptions>(IServiceCollection, String) AddOptions<TOptions>(IServiceCollection, String) AddOptions<TOptions>(IServiceCollection, String)

Gets an options builder that forwards Configure calls for the same named TOptions to the underlying service collection.

AddOptions(IServiceCollection) AddOptions(IServiceCollection) AddOptions(IServiceCollection)

Adds services required for using options.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddOptions (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddOptions : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddOptions (services As IServiceCollection) As IServiceCollection
Parameters
Returns

The IServiceCollection so that additional calls can be chained.

AddOptions<TOptions>(IServiceCollection) AddOptions<TOptions>(IServiceCollection) AddOptions<TOptions>(IServiceCollection)

Gets an options builder that forwards Configure calls for the same TOptions to the underlying service collection.

public static Microsoft.Extensions.Options.OptionsBuilder<TOptions> AddOptions<TOptions> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TOptions : class;
static member AddOptions : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)> (requires 'Options : null)
<Extension()>
Public Function AddOptions(Of TOptions As Class) (services As IServiceCollection) As OptionsBuilder(Of TOptions)
Type Parameters
TOptions

The options type to be configured.

Parameters
Returns

AddOptions<TOptions>(IServiceCollection, String) AddOptions<TOptions>(IServiceCollection, String) AddOptions<TOptions>(IServiceCollection, String)

Gets an options builder that forwards Configure calls for the same named TOptions to the underlying service collection.

public static Microsoft.Extensions.Options.OptionsBuilder<TOptions> AddOptions<TOptions> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name) where TOptions : class;
static member AddOptions : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)> (requires 'Options : null)
<Extension()>
Public Function AddOptions(Of TOptions As Class) (services As IServiceCollection, name As String) As OptionsBuilder(Of TOptions)
Type Parameters
TOptions

The options type to be configured.

Parameters
name
String String String

The name of the options instance.

Returns

Applies to