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
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET