OptionsServiceCollectionExtensions.AddOptions Método

Definição

Sobrecargas

AddOptions(IServiceCollection)

Adiciona os serviços necessários para usar as opções.Adds services required for using options.

AddOptions<TOptions>(IServiceCollection)

Obtém um construtor de opções que encaminha as chamadas de Configuração para o mesmo TOptions nomeado para a coleção de serviços subjacente.Gets an options builder that forwards Configure calls for the same named TOptions to the underlying service collection.

AddOptions<TOptions>(IServiceCollection, String)

Obtém um construtor de opções que encaminha as chamadas de Configuração para o mesmo TOptions nomeado para a coleção de serviços subjacente.Gets an options builder that forwards Configure calls for the same named TOptions to the underlying service collection.

AddOptions(IServiceCollection)

Adiciona os serviços necessários para usar as opções.Adds services required for using options.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddOptions(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
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

Parâmetros

services
IServiceCollection

O IServiceCollection ao qual adicionar os serviços.The IServiceCollection to add the services to.

Retornos

IServiceCollection

O IServiceCollection para que chamadas adicionais possam ser encadeadas.The IServiceCollection so that additional calls can be chained.

Aplica-se a

AddOptions<TOptions>(IServiceCollection)

Obtém um construtor de opções que encaminha as chamadas de Configuração para o mesmo TOptions nomeado para a coleção de serviços subjacente.Gets an options builder that forwards Configure calls for the same named TOptions to the underlying service collection.

public:
generic <typename TOptions>
 where TOptions : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ AddOptions(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
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)

Parâmetros de tipo

TOptions

O tipo de opções a ser configurado.The options type to be configured.

Parâmetros

services
IServiceCollection

O IServiceCollection ao qual adicionar os serviços.The IServiceCollection to add the services to.

Retornos

OptionsBuilder<TOptions>

O OptionsBuilder<TOptions> para que chamadas de configuração possam ser encadeada nele.The OptionsBuilder<TOptions> so that configure calls can be chained in it.

Aplica-se a

AddOptions<TOptions>(IServiceCollection, String)

Obtém um construtor de opções que encaminha as chamadas de Configuração para o mesmo TOptions nomeado para a coleção de serviços subjacente.Gets an options builder that forwards Configure calls for the same named TOptions to the underlying service collection.

public:
generic <typename TOptions>
 where TOptions : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ AddOptions(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name);
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)

Parâmetros de tipo

TOptions

O tipo de opções a ser configurado.The options type to be configured.

Parâmetros

services
IServiceCollection

O IServiceCollection ao qual adicionar os serviços.The IServiceCollection to add the services to.

name
String

O nome da instância de opções.The name of the options instance.

Retornos

OptionsBuilder<TOptions>

O OptionsBuilder<TOptions> para que as chamadas de Configuração possam ser encadeadas.The OptionsBuilder<TOptions> so that Configure calls can be chained in it.

Aplica-se a