OptionsBuilder<TOptions>.Validate 方法

定义

重载

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.

Validate(Func<TOptions,Boolean>)

使用默认失败消息注册选项类型的验证操作。Register a validation action for an options type using a default failure message.

public:
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, bool> ^ validation);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate (Func<TOptions,bool> validation);
abstract member Validate : Func<'Options, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate (validation As Func(Of TOptions, Boolean)) As OptionsBuilder(Of TOptions)

参数

validation
Func<TOptions,Boolean>

验证函数。The validation function.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

Validate(Func<TOptions,Boolean>, String)

注册选项类型的验证操作。Register a validation action for an options type.

public:
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, bool> ^ validation, System::String ^ failureMessage);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate (Func<TOptions,bool> validation, string failureMessage);
abstract member Validate : Func<'Options, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate (validation As Func(Of TOptions, Boolean), failureMessage As String) As OptionsBuilder(Of TOptions)

参数

validation
Func<TOptions,Boolean>

验证函数。The validation function.

failureMessage
String

在验证失败时使用的失败消息。The failure message to use when validation fails.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

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

使用默认失败消息注册选项类型的验证操作。Register a validation action for an options type using a default failure message.

public:
generic <typename TDep>
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, TDep, bool> ^ validation);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate<TDep> (Func<TOptions,TDep,bool> validation);
abstract member Validate : Func<'Options, 'Dep, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, 'Dep, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate(Of TDep) (validation As Func(Of TOptions, TDep, Boolean)) As OptionsBuilder(Of TOptions)

类型参数

TDep

验证函数使用的依赖项。The dependency used by the validation function.

参数

validation
Func<TOptions,TDep,Boolean>

验证函数。The validation function.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

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

注册选项类型的验证操作。Register a validation action for an options type.

public:
generic <typename TDep>
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, TDep, bool> ^ validation, System::String ^ failureMessage);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate<TDep> (Func<TOptions,TDep,bool> validation, string failureMessage);
abstract member Validate : Func<'Options, 'Dep, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, 'Dep, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate(Of TDep) (validation As Func(Of TOptions, TDep, Boolean), failureMessage As String) As OptionsBuilder(Of TOptions)

类型参数

TDep

验证函数使用的依赖项。The dependency used by the validation function.

参数

validation
Func<TOptions,TDep,Boolean>

验证函数。The validation function.

failureMessage
String

在验证失败时使用的失败消息。The failure message to use when validation fails.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

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.

public:
generic <typename TDep1, typename TDep2, typename TDep3, typename TDep4, typename TDep5>
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, bool> ^ validation);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate<TDep1,TDep2,TDep3,TDep4,TDep5> (Func<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5,bool> validation);
abstract member Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, 'TDep4, 'TDep5, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, 'TDep4, 'TDep5, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate(Of TDep1, TDep2, TDep3, TDep4, TDep5) (validation As Func(Of TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, Boolean)) As OptionsBuilder(Of TOptions)

类型参数

TDep1

验证函数使用的第一个依赖项。The first dependency used by the validation function.

TDep2

验证函数使用的第二个依赖项。The second dependency used by the validation function.

TDep3

验证函数使用的第三个依赖项。The third dependency used by the validation function.

TDep4

验证函数使用的第四个依赖项。The fourth dependency used by the validation function.

TDep5

验证函数使用的第五个依赖项。The fifth dependency used by the validation function.

参数

validation
Func<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5,Boolean>

验证函数。The validation function.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

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

注册选项类型的验证操作。Register a validation action for an options type.

public:
generic <typename TDep1, typename TDep2, typename TDep3, typename TDep4, typename TDep5>
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, bool> ^ validation, System::String ^ failureMessage);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate<TDep1,TDep2,TDep3,TDep4,TDep5> (Func<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5,bool> validation, string failureMessage);
abstract member Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, 'TDep4, 'TDep5, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, 'TDep4, 'TDep5, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate(Of TDep1, TDep2, TDep3, TDep4, TDep5) (validation As Func(Of TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, Boolean), failureMessage As String) As OptionsBuilder(Of TOptions)

类型参数

TDep1

验证函数使用的第一个依赖项。The first dependency used by the validation function.

TDep2

验证函数使用的第二个依赖项。The second dependency used by the validation function.

TDep3

验证函数使用的第三个依赖项。The third dependency used by the validation function.

TDep4

验证函数使用的第四个依赖项。The fourth dependency used by the validation function.

TDep5

验证函数使用的第五个依赖项。The fifth dependency used by the validation function.

参数

validation
Func<TOptions,TDep1,TDep2,TDep3,TDep4,TDep5,Boolean>

验证函数。The validation function.

failureMessage
String

在验证失败时使用的失败消息。The failure message to use when validation fails.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

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.

public:
generic <typename TDep1, typename TDep2, typename TDep3, typename TDep4>
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, TDep1, TDep2, TDep3, TDep4, bool> ^ validation);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate<TDep1,TDep2,TDep3,TDep4> (Func<TOptions,TDep1,TDep2,TDep3,TDep4,bool> validation);
abstract member Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, 'TDep4, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, 'TDep4, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate(Of TDep1, TDep2, TDep3, TDep4) (validation As Func(Of TOptions, TDep1, TDep2, TDep3, TDep4, Boolean)) As OptionsBuilder(Of TOptions)

类型参数

TDep1

验证函数使用的第一个依赖项。The first dependency used by the validation function.

TDep2

验证函数使用的第二个依赖项。The second dependency used by the validation function.

TDep3

验证函数使用的第三个依赖项。The third dependency used by the validation function.

TDep4

验证函数使用的第四个依赖项。The fourth dependency used by the validation function.

参数

validation
Func<TOptions,TDep1,TDep2,TDep3,TDep4,Boolean>

验证函数。The validation function.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

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

注册选项类型的验证操作。Register a validation action for an options type.

public:
generic <typename TDep1, typename TDep2, typename TDep3, typename TDep4>
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, TDep1, TDep2, TDep3, TDep4, bool> ^ validation, System::String ^ failureMessage);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate<TDep1,TDep2,TDep3,TDep4> (Func<TOptions,TDep1,TDep2,TDep3,TDep4,bool> validation, string failureMessage);
abstract member Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, 'TDep4, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, 'TDep4, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate(Of TDep1, TDep2, TDep3, TDep4) (validation As Func(Of TOptions, TDep1, TDep2, TDep3, TDep4, Boolean), failureMessage As String) As OptionsBuilder(Of TOptions)

类型参数

TDep1

验证函数使用的第一个依赖项。The first dependency used by the validation function.

TDep2

验证函数使用的第二个依赖项。The second dependency used by the validation function.

TDep3

验证函数使用的第三个依赖项。The third dependency used by the validation function.

TDep4

验证函数使用的第四个依赖项。The fourth dependency used by the validation function.

参数

validation
Func<TOptions,TDep1,TDep2,TDep3,TDep4,Boolean>

验证函数。The validation function.

failureMessage
String

在验证失败时使用的失败消息。The failure message to use when validation fails.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

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

使用默认失败消息注册选项类型的验证操作。Register a validation action for an options type using a default failure message.

public:
generic <typename TDep1, typename TDep2, typename TDep3>
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, TDep1, TDep2, TDep3, bool> ^ validation);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate<TDep1,TDep2,TDep3> (Func<TOptions,TDep1,TDep2,TDep3,bool> validation);
abstract member Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate(Of TDep1, TDep2, TDep3) (validation As Func(Of TOptions, TDep1, TDep2, TDep3, Boolean)) As OptionsBuilder(Of TOptions)

类型参数

TDep1

验证函数使用的第一个依赖项。The first dependency used by the validation function.

TDep2

验证函数使用的第二个依赖项。The second dependency used by the validation function.

TDep3

验证函数使用的第三个依赖项。The third dependency used by the validation function.

参数

validation
Func<TOptions,TDep1,TDep2,TDep3,Boolean>

验证函数。The validation function.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

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

注册选项类型的验证操作。Register a validation action for an options type.

public:
generic <typename TDep1, typename TDep2, typename TDep3>
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, TDep1, TDep2, TDep3, bool> ^ validation, System::String ^ failureMessage);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate<TDep1,TDep2,TDep3> (Func<TOptions,TDep1,TDep2,TDep3,bool> validation, string failureMessage);
abstract member Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, 'TDep1, 'TDep2, 'TDep3, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate(Of TDep1, TDep2, TDep3) (validation As Func(Of TOptions, TDep1, TDep2, TDep3, Boolean), failureMessage As String) As OptionsBuilder(Of TOptions)

类型参数

TDep1

验证函数使用的第一个依赖项。The first dependency used by the validation function.

TDep2

验证函数使用的第二个依赖项。The second dependency used by the validation function.

TDep3

验证函数使用的第三个依赖项。The third dependency used by the validation function.

参数

validation
Func<TOptions,TDep1,TDep2,TDep3,Boolean>

验证函数。The validation function.

failureMessage
String

在验证失败时使用的失败消息。The failure message to use when validation fails.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

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

使用默认失败消息注册选项类型的验证操作。Register a validation action for an options type using a default failure message.

public:
generic <typename TDep1, typename TDep2>
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, TDep1, TDep2, bool> ^ validation);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate<TDep1,TDep2> (Func<TOptions,TDep1,TDep2,bool> validation);
abstract member Validate : Func<'Options, 'TDep1, 'TDep2, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, 'TDep1, 'TDep2, bool (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate(Of TDep1, TDep2) (validation As Func(Of TOptions, TDep1, TDep2, Boolean)) As OptionsBuilder(Of TOptions)

类型参数

TDep1

验证函数使用的第一个依赖项。The first dependency used by the validation function.

TDep2

验证函数使用的第二个依赖项。The second dependency used by the validation function.

参数

validation
Func<TOptions,TDep1,TDep2,Boolean>

验证函数。The validation function.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于

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

注册选项类型的验证操作。Register a validation action for an options type.

public:
generic <typename TDep1, typename TDep2>
 virtual Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ Validate(Func<TOptions, TDep1, TDep2, bool> ^ validation, System::String ^ failureMessage);
public virtual Microsoft.Extensions.Options.OptionsBuilder<TOptions> Validate<TDep1,TDep2> (Func<TOptions,TDep1,TDep2,bool> validation, string failureMessage);
abstract member Validate : Func<'Options, 'TDep1, 'TDep2, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
override this.Validate : Func<'Options, 'TDep1, 'TDep2, bool (requires 'Options : null)> * string -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)>
Public Overridable Function Validate(Of TDep1, TDep2) (validation As Func(Of TOptions, TDep1, TDep2, Boolean), failureMessage As String) As OptionsBuilder(Of TOptions)

类型参数

TDep1

验证函数使用的第一个依赖项。The first dependency used by the validation function.

TDep2

验证函数使用的第二个依赖项。The second dependency used by the validation function.

参数

validation
Func<TOptions,TDep1,TDep2,Boolean>

验证函数。The validation function.

failureMessage
String

在验证失败时使用的失败消息。The failure message to use when validation fails.

返回

OptionsBuilder<TOptions>

当前的 OptionsBuilder<TOptions>The current OptionsBuilder<TOptions>.

适用于