OptionsServiceCollectionExtensions.ConfigureOptions 方法

定義

多載

ConfigureOptions(IServiceCollection, Object)

註冊將會註冊其所有 I[Post]ConfigureOptions 的物件。Registers an object that will have all of its I[Post]ConfigureOptions registered.

ConfigureOptions(IServiceCollection, Type)

註冊將會註冊其所有 I[Post]ConfigureOptions 的類型。Registers a type that will have all of its I[Post]ConfigureOptions registered.

ConfigureOptions<TConfigureOptions>(IServiceCollection)

註冊將會註冊其所有 I[Post]ConfigureOptions 的類型。Registers a type that will have all of its I[Post]ConfigureOptions registered.

ConfigureOptions(IServiceCollection, Object)

註冊將會註冊其所有 I[Post]ConfigureOptions 的物件。Registers an object that will have all of its I[Post]ConfigureOptions registered.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ ConfigureOptions(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::Object ^ configureInstance);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureOptions (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, object configureInstance);
static member ConfigureOptions : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function ConfigureOptions (services As IServiceCollection, configureInstance As Object) As IServiceCollection

參數

services
IServiceCollection

要新增服務的 IServiceCollectionThe IServiceCollection to add the services to.

configureInstance
Object

將設定選項的執行個體。The instance that will configure options.

傳回

IServiceCollection,讓其他呼叫可以進行鏈結。The IServiceCollection so that additional calls can be chained.

ConfigureOptions(IServiceCollection, Type)

註冊將會註冊其所有 I[Post]ConfigureOptions 的類型。Registers a type that will have all of its I[Post]ConfigureOptions registered.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ ConfigureOptions(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ configureType);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureOptions (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type configureType);
static member ConfigureOptions : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function ConfigureOptions (services As IServiceCollection, configureType As Type) As IServiceCollection

參數

services
IServiceCollection

要新增服務的 IServiceCollectionThe IServiceCollection to add the services to.

configureType
Type

將會設定選項的類型。The type that will configure options.

傳回

IServiceCollection,讓其他呼叫可以進行鏈結。The IServiceCollection so that additional calls can be chained.

ConfigureOptions<TConfigureOptions>(IServiceCollection)

註冊將會註冊其所有 I[Post]ConfigureOptions 的類型。Registers a type that will have all of its I[Post]ConfigureOptions registered.

public:
generic <typename TConfigureOptions>
 where TConfigureOptions : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ ConfigureOptions(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureOptions<TConfigureOptions> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TConfigureOptions : class;
static member ConfigureOptions : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'ConfigureOptions : null)
<Extension()>
Public Function ConfigureOptions(Of TConfigureOptions As Class) (services As IServiceCollection) As IServiceCollection

類型參數

TConfigureOptions

要設定選項的類型。The type that will configure options.

參數

services
IServiceCollection

要新增服務的 IServiceCollectionThe IServiceCollection to add the services to.

傳回

IServiceCollection,讓其他呼叫可以進行鏈結。The IServiceCollection so that additional calls can be chained.

適用於