EditContextDataAnnotationsExtensions.EnableDataAnnotationsValidation 方法

定义

重载

EnableDataAnnotationsValidation(EditContext)
已过时.

为 启用 DataAnnotations 验证支持 EditContext

EnableDataAnnotationsValidation(EditContext, IServiceProvider)

为 启用 DataAnnotations 验证支持 EditContext

EnableDataAnnotationsValidation(EditContext)

Source:
EditContextDataAnnotationsExtensions.cs
Source:
EditContextDataAnnotationsExtensions.cs
Source:
EditContextDataAnnotationsExtensions.cs
Source:
EditContextDataAnnotationsExtensions.cs

注意

This API is obsolete and may be removed in future versions. Use the overload that accepts an IServiceProvider instead.

为 启用 DataAnnotations 验证支持 EditContext

public static IDisposable EnableDataAnnotationsValidation (this Microsoft.AspNetCore.Components.Forms.EditContext editContext);
[System.Obsolete("This API is obsolete and may be removed in future versions. Use the overload that accepts an IServiceProvider instead.")]
public static IDisposable EnableDataAnnotationsValidation (this Microsoft.AspNetCore.Components.Forms.EditContext editContext);
static member EnableDataAnnotationsValidation : Microsoft.AspNetCore.Components.Forms.EditContext -> IDisposable
[<System.Obsolete("This API is obsolete and may be removed in future versions. Use the overload that accepts an IServiceProvider instead.")>]
static member EnableDataAnnotationsValidation : Microsoft.AspNetCore.Components.Forms.EditContext -> IDisposable
<Extension()>
Public Function EnableDataAnnotationsValidation (editContext As EditContext) As IDisposable

参数

editContext
EditContext

EditContext

返回

一个可释放对象,其处置将从 中删除 DataAnnotations 验证支持 EditContext

属性

适用于

EnableDataAnnotationsValidation(EditContext, IServiceProvider)

Source:
EditContextDataAnnotationsExtensions.cs
Source:
EditContextDataAnnotationsExtensions.cs
Source:
EditContextDataAnnotationsExtensions.cs

为 启用 DataAnnotations 验证支持 EditContext

public static IDisposable EnableDataAnnotationsValidation (this Microsoft.AspNetCore.Components.Forms.EditContext editContext, IServiceProvider serviceProvider);
static member EnableDataAnnotationsValidation : Microsoft.AspNetCore.Components.Forms.EditContext * IServiceProvider -> IDisposable
<Extension()>
Public Function EnableDataAnnotationsValidation (editContext As EditContext, serviceProvider As IServiceProvider) As IDisposable

参数

editContext
EditContext

EditContext

serviceProvider
IServiceProvider

IServiceProvider要用于 的 ValidationContext

返回

一个可释放对象,其处置将从 中删除 DataAnnotations 验证支持 EditContext

适用于