共用方式為


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>,以便鏈結其他呼叫。

適用於