Method IsValid
IsValid(object?)
Determines whether the specified value of the object is valid.
Declaration
public override bool IsValid(object? value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value of the object to validate. |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The current attribute is malformed. |
| NotImplementedException | Neither overload of |
IsValid(object?, ValidationContext)
Validates the specified value with respect to the current validation attribute.
Declaration
protected override ValidationResult? IsValid(object? value, ValidationContext validationContext)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value to validate. |
| ValidationContext | validationContext | The context information about the validation operation. |
Returns
| Type | Description |
|---|---|
| ValidationResult | An instance of the ValidationResult class. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The current attribute is malformed. |
| NotImplementedException | IsValid(object, ValidationContext) has not been implemented by a derived class. |