OptionsBuilderDataAnnotationsExtensions.ValidateDataAnnotations<TOptions> 方法

定义

注册此选项实例以验证其 DataAnnotations。

public:
generic <typename TOptions>
 where TOptions : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ ValidateDataAnnotations(Microsoft::Extensions::Options::OptionsBuilder<TOptions> ^ optionsBuilder);
public static Microsoft.Extensions.Options.OptionsBuilder<TOptions> ValidateDataAnnotations<TOptions> (this Microsoft.Extensions.Options.OptionsBuilder<TOptions> optionsBuilder) where TOptions : class;
static member ValidateDataAnnotations : Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)> -> Microsoft.Extensions.Options.OptionsBuilder<'Options (requires 'Options : null)> (requires 'Options : null)
<Extension()>
Public Function ValidateDataAnnotations(Of TOptions As Class) (optionsBuilder As OptionsBuilder(Of TOptions)) As OptionsBuilder(Of TOptions)

类型参数

TOptions

要配置的选项类型。

参数

optionsBuilder
OptionsBuilder<TOptions>

向其中添加服务的选项生成器。

返回

OptionsBuilder<TOptions>,以便可以链接其他调用。

适用于