OptionsServiceCollectionExtensions.ConfigureAll<TOptions>(IServiceCollection, Action<TOptions>) 方法

定義

註冊用於設定特定選項類型的所有執行個體動作。Registers an action used to configure all instances of a particular type of options.

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

類型參數

TOptions

要設定的選項類型。The options type to be configured.

參數

services
IServiceCollection

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

configureOptions
Action<TOptions>

用來設定選項的動作。The action used to configure the options.

傳回

IServiceCollection,以便鏈結其他呼叫。The IServiceCollection so that additional calls can be chained.

適用於