EditContextDataAnnotationsExtensions.EnableDataAnnotationsValidation Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
EnableDataAnnotationsValidation(EditContext) |
Obsolete.
Enables DataAnnotations validation support for the EditContext. |
EnableDataAnnotationsValidation(EditContext, IServiceProvider) |
Enables DataAnnotations validation support for the EditContext. |
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.
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
Parameters
- editContext
- EditContext
The EditContext.
Returns
A disposable object whose disposal will remove DataAnnotations validation support from the EditContext.
- Attributes
Applies to
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.