OptionsServiceCollectionExtensions.AddOptions Méthode

Définition

Surcharges

AddOptions(IServiceCollection)

Ajoute les services nécessaires à l’utilisation des options.Adds services required for using options.

AddOptions<TOptions>(IServiceCollection)

Obtient un générateur d’options qui transfère les appels de configuration pour le même TOptions à la collection de services sous-jacente.Gets an options builder that forwards Configure calls for the same TOptions to the underlying service collection.

AddOptions<TOptions>(IServiceCollection, String)

Obtient un générateur d’options qui transfère les appels de configuration pour le même TOptions nommé à la collection de services sous-jacente.Gets an options builder that forwards Configure calls for the same named TOptions to the underlying service collection.

AddOptions(IServiceCollection)

Ajoute les services nécessaires à l’utilisation des options.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

Paramètres

services
IServiceCollection

IServiceCollection auquel ajouter les services.The IServiceCollection to add the services to.

Retours

IServiceCollection afin que les appels supplémentaires puissent être chaînés.The IServiceCollection so that additional calls can be chained.

AddOptions<TOptions>(IServiceCollection)

Obtient un générateur d’options qui transfère les appels de configuration pour le même TOptions à la collection de services sous-jacente.Gets an options builder that forwards Configure calls for the same 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)

Paramètres de type

TOptions

Type d’options à configurer.The options type to be configured.

Paramètres

services
IServiceCollection

IServiceCollection auquel ajouter les services.The IServiceCollection to add the services to.

Retours

OptionsBuilder<TOptions> pour que les appels de configuration puissent y être chaînés.The OptionsBuilder<TOptions> so that configure calls can be chained in it.

AddOptions<TOptions>(IServiceCollection, String)

Obtient un générateur d’options qui transfère les appels de configuration pour le même TOptions nommé à la collection de services sous-jacente.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)

Paramètres de type

TOptions

Type d’options à configurer.The options type to be configured.

Paramètres

services
IServiceCollection

IServiceCollection auquel ajouter les services.The IServiceCollection to add the services to.

name
String

Nom de l’instance d’options.The name of the options instance.

Retours

OptionsBuilder<TOptions> pour que les appels de configuration puissent y être chaînés.The OptionsBuilder<TOptions> so that configure calls can be chained in it.

S’applique à