OptionsServiceCollectionExtensions 類別

定義

將選項服務新增至 DI 容器的擴充方法。Extension methods for adding options services to the DI container.

public ref class OptionsServiceCollectionExtensions abstract sealed
public static class OptionsServiceCollectionExtensions
type OptionsServiceCollectionExtensions = class
Public Module OptionsServiceCollectionExtensions
繼承
OptionsServiceCollectionExtensions

方法

AddOptions(IServiceCollection)

新增使用選項所需的服務。Adds services required for using options.

AddOptions<TOptions>(IServiceCollection)

取得選項產生器,將同樣名為 TOptionsConfigure 呼叫轉寄至基礎服務集合。Gets an options builder that forwards Configure calls for the same named TOptions to the underlying service collection.

AddOptions<TOptions>(IServiceCollection, String)

取得選項產生器,將同樣名為 TOptionsConfigure 呼叫轉寄至基礎服務集合。Gets an options builder that forwards Configure calls for the same named TOptions to the underlying service collection.

Configure<TOptions>(IServiceCollection, Action<TOptions>)

註冊用來在啟動期間一次設定特定選項類型的動作。Registers an action used to configure a particular type of options once during startup. 這會在 PostConfigure<TOptions>(IServiceCollection, Action<TOptions>) 之前執行。This is run before PostConfigure<TOptions>(IServiceCollection, Action<TOptions>). 對設定進行更新不會再次叫用動作。Updates to the configuration does not invoke the action again.

Configure<TOptions>(IServiceCollection, String, Action<TOptions>)

註冊用來設定特定選項類型的動作。Registers an action used to configure a particular type of options. 這些會在 PostConfigure<TOptions>(IServiceCollection, Action<TOptions>) 之前執行。These are run before PostConfigure<TOptions>(IServiceCollection, Action<TOptions>).

ConfigureAll<TOptions>(IServiceCollection, Action<TOptions>)

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

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.

PostConfigure<TOptions>(IServiceCollection, Action<TOptions>)

註冊用於初始化特定類型選項的動作。Registers an action used to initialize a particular type of options. 這些會在 Configure<TOptions>(IServiceCollection, Action<TOptions>) 之後執行。These are run after Configure<TOptions>(IServiceCollection, Action<TOptions>).

PostConfigure<TOptions>(IServiceCollection, String, Action<TOptions>)

註冊用來設定特定選項類型的動作。Registers an action used to configure a particular type of options. 這些會在 Configure<TOptions>(IServiceCollection, Action<TOptions>) 之後執行。These are run after Configure<TOptions>(IServiceCollection, Action<TOptions>).

PostConfigureAll<TOptions>(IServiceCollection, Action<TOptions>)

註冊用於張貼設定特定選項類型的所有執行個體動作。Registers an action used to post configure all instances of a particular type of options. 這些會在 Configure<TOptions>(IServiceCollection, Action<TOptions>) 之後執行。These are run after Configure<TOptions>(IServiceCollection, Action<TOptions>).

適用於