OptionsBuilder<TOptions> 類別

定義

用來設定 TOptions 執行個體。Used to configure TOptions instances.

generic <typename TOptions>
 where TOptions : classpublic ref class OptionsBuilder
public class OptionsBuilder<TOptions> where TOptions : class
type OptionsBuilder<'Options (requires 'Options : null)> = class
Public Class OptionsBuilder(Of TOptions)

類型參數

TOptions

要求的選項類型。The type of options being requested.

繼承
OptionsBuilder<TOptions>

建構函式

OptionsBuilder<TOptions>(IServiceCollection, String)

建構函式。Constructor.

屬性

Name

TOptions 執行個體的預設名稱。The default name of the TOptions instance.

Services

正在設定選項的 IServiceCollectionThe IServiceCollection for the options being configured.

方法

Configure(Action<TOptions>)

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

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

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

Configure<TDep1,TDep2,TDep3,TDep4,TDep5>(Action<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5>)

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

Configure<TDep1,TDep2,TDep3,TDep4>(Action<TOptions,TDep1,TDep2,TDep3,TDep4>)

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

Configure<TDep1,TDep2,TDep3>(Action<TOptions,TDep1,TDep2,TDep3>)

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

Configure<TDep1,TDep2>(Action<TOptions,TDep1,TDep2>)

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

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
PostConfigure(Action<TOptions>)

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

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

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

PostConfigure<TDep1,TDep2,TDep3,TDep4,TDep5>(Action<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5>)

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

PostConfigure<TDep1,TDep2,TDep3,TDep4>(Action<TOptions,TDep1,TDep2,TDep3,TDep4>)

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

PostConfigure<TDep1,TDep2,TDep3>(Action<TOptions,TDep1,TDep2,TDep3>)

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

PostConfigure<TDep1,TDep2>(Action<TOptions,TDep1,TDep2>)

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

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
Validate(Func<TOptions,Boolean>)

使用預設失敗訊息註冊選項類型的驗證動作。Register a validation action for an options type using a default failure message.

Validate(Func<TOptions,Boolean>, String)

註冊選項類型的驗證動作。Register a validation action for an options type.

Validate<TDep>(Func<TOptions,TDep,Boolean>)

使用預設失敗訊息註冊選項類型的驗證動作。Register a validation action for an options type using a default failure message.

Validate<TDep>(Func<TOptions,TDep,Boolean>, String)

註冊選項類型的驗證動作。Register a validation action for an options type.

Validate<TDep1,TDep2,TDep3,TDep4,TDep5>(Func<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5,Boolean>)

使用預設失敗訊息註冊選項類型的驗證動作。Register a validation action for an options type using a default failure message.

Validate<TDep1,TDep2,TDep3,TDep4,TDep5>(Func<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5,Boolean>, String)

註冊選項類型的驗證動作。Register a validation action for an options type.

Validate<TDep1,TDep2,TDep3,TDep4>(Func<TOptions,TDep1,TDep2,TDep3,TDep4,Boolean>)

使用預設失敗訊息註冊選項類型的驗證動作。Register a validation action for an options type using a default failure message.

Validate<TDep1,TDep2,TDep3,TDep4>(Func<TOptions,TDep1,TDep2,TDep3,TDep4,Boolean>, String)

註冊選項類型的驗證動作。Register a validation action for an options type.

Validate<TDep1,TDep2,TDep3>(Func<TOptions,TDep1,TDep2,TDep3,Boolean>)

使用預設失敗訊息註冊選項類型的驗證動作。Register a validation action for an options type using a default failure message.

Validate<TDep1,TDep2,TDep3>(Func<TOptions,TDep1,TDep2,TDep3,Boolean>, String)

註冊選項類型的驗證動作。Register a validation action for an options type.

Validate<TDep1,TDep2>(Func<TOptions,TDep1,TDep2,Boolean>)

使用預設失敗訊息註冊選項類型的驗證動作。Register a validation action for an options type using a default failure message.

Validate<TDep1,TDep2>(Func<TOptions,TDep1,TDep2,Boolean>, String)

註冊選項類型的驗證動作。Register a validation action for an options type.

擴充方法

Bind<TOptions>(OptionsBuilder<TOptions>, IConfiguration)

註冊 TOptions 將繫結的組態執行個體。Registers a configuration instance which TOptions will bind against.

Bind<TOptions>(OptionsBuilder<TOptions>, IConfiguration, Action<BinderOptions>)

註冊 TOptions 將繫結的組態執行個體。Registers a configuration instance which TOptions will bind against.

BindConfiguration<TOptions>(OptionsBuilder<TOptions>, String, Action<BinderOptions>)

註冊相依性插入容器,將 TOptions 繫結至從 DI 服務提供者取得的 IConfigurationRegisters the dependency injection container to bind TOptions against the IConfiguration obtained from the DI service provider.

ValidateDataAnnotations<TOptions>(OptionsBuilder<TOptions>)

註冊此選項執行個體以驗證其 DataAnnotations。Registers this options instance for validation of its DataAnnotations.

ValidateOnStart<TOptions>(OptionsBuilder<TOptions>)

適用於