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
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示