ValidationAttribute.GetValidationResult(Object, ValidationContext) Method
Definition
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 value is valid with respect to the current validation attribute.
public:
System::ComponentModel::DataAnnotations::ValidationResult ^ GetValidationResult(System::Object ^ value, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext);
public System.ComponentModel.DataAnnotations.ValidationResult GetValidationResult (object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
public System.ComponentModel.DataAnnotations.ValidationResult? GetValidationResult (object? value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
member this.GetValidationResult : obj * System.ComponentModel.DataAnnotations.ValidationContext -> System.ComponentModel.DataAnnotations.ValidationResult
Public Function GetValidationResult (value As Object, validationContext As ValidationContext) As ValidationResult
Parameters
- value
- Object
The value to validate.
- validationContext
- ValidationContext
The context information about the validation operation.
Returns
An instance of the ValidationResult class.
Exceptions
The current attribute is malformed.
validationContext
is null
.
IsValid(Object, ValidationContext) has not been implemented by a derived class.
Remarks
The GetValidationResult method checks validity without throwing an exception.
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om