Dela via


EditContextDataAnnotationsExtensions.EnableDataAnnotationsValidation Method

Definition

Overloads

EnableDataAnnotationsValidation(EditContext)
Obsolete.

Enables DataAnnotations validation support for the EditContext.

EnableDataAnnotationsValidation(EditContext, IServiceProvider)

Enables DataAnnotations validation support for the EditContext.

EnableDataAnnotationsValidation(EditContext)

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

Caution

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

Enables DataAnnotations validation support for the 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);
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.")>]
static member EnableDataAnnotationsValidation : Microsoft.AspNetCore.Components.Forms.EditContext -> IDisposable
static member EnableDataAnnotationsValidation : Microsoft.AspNetCore.Components.Forms.EditContext -> IDisposable
<Extension()>
Public Function EnableDataAnnotationsValidation (editContext As EditContext) As IDisposable

Parameters

editContext
EditContext

The EditContext.

Returns

A disposable object whose disposal will remove DataAnnotations validation support from the EditContext.

Attributes

Applies to

EnableDataAnnotationsValidation(EditContext, IServiceProvider)

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

Enables DataAnnotations validation support for the 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

Parameters

editContext
EditContext

The EditContext.

serviceProvider
IServiceProvider

The IServiceProvider to be used in the ValidationContext.

Returns

A disposable object whose disposal will remove DataAnnotations validation support from the EditContext.

Applies to