Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
Checks whether the specified object is valid.
IsValid(Object) |
Determines whether the specified value of the object is valid. |
IsValid(Object, ValidationContext) |
Validates the specified value with respect to the current validation attribute. |
Determines whether the specified value of the object is valid.
public:
virtual bool IsValid(System::Object ^ value);
public:
abstract bool IsValid(System::Object ^ value);
public virtual bool IsValid(object value);
public virtual bool IsValid(object? value);
public abstract bool IsValid(object value);
abstract member IsValid : obj -> bool
override this.IsValid : obj -> bool
abstract member IsValid : obj -> bool
Public Overridable Function IsValid (value As Object) As Boolean
Public MustOverride Function IsValid (value As Object) As Boolean
The value of the object to validate.
true
if the specified value is valid; otherwise, false
.
The current attribute is malformed.
Neither overload of IsValid
has been implemented by a derived class.
If you inherit from the ValidationAttribute class, you must implement the validation logic in this method.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
UWP | 10.0 |
Validates the specified value with respect to the current validation attribute.
protected:
virtual System::ComponentModel::DataAnnotations::ValidationResult ^ IsValid(System::Object ^ value, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext);
protected virtual System.ComponentModel.DataAnnotations.ValidationResult IsValid(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
protected virtual System.ComponentModel.DataAnnotations.ValidationResult? IsValid(object? value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
abstract member IsValid : obj * System.ComponentModel.DataAnnotations.ValidationContext -> System.ComponentModel.DataAnnotations.ValidationResult
override this.IsValid : obj * System.ComponentModel.DataAnnotations.ValidationContext -> System.ComponentModel.DataAnnotations.ValidationResult
Protected Overridable Function IsValid (value As Object, validationContext As ValidationContext) As ValidationResult
The value to validate.
The context information about the validation operation.
An instance of the ValidationResult class.
The current attribute is malformed.
IsValid(Object, ValidationContext) has not been implemented by a derived class.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in