Language

ValidationAttribute.RequiresValidationContext Property

Definition

Gets a value that indicates whether the attribute requires validation context.

public:
 virtual property bool RequiresValidationContext { bool get(); };
public virtual bool RequiresValidationContext { get; }
member this.RequiresValidationContext : bool
Public Overridable ReadOnly Property RequiresValidationContext As Boolean

Property Value

true if the attribute requires validation context; otherwise, false.

Remarks

This property is a hint for callers deciding whether a ValidationContext must be supplied. The asynchronous validation entry point GetValidationResultAsync(Object, ValidationContext, CancellationToken) always requires a non-null ValidationContext parameter, so this property is not applicable to the asynchronous pipeline.

Applies to