Class RequiredAttribute<T>
Checks whether the data field of type Optional<T> has a value.
Inherited Members
Namespace: DotNext.ComponentModel.DataAnnotations
Assembly: DotNext.dll
Syntax
public sealed class RequiredAttribute<T> : RequiredAttribute
Type Parameters
Name | Description |
---|---|
T | The type of Optional<T> value. |
Properties
| Edit this page View SourceAllowNull
Specifies whether Optional<T> may contain null value.
Declaration
public bool AllowNull { get; init; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceIsValid(object?)
Checks that the value of the required data field is not empty.
Declaration
public override bool IsValid(object? value)
Parameters
Type | Name | Description |
---|---|---|
object | value | The data field value to validate. |
Returns
Type | Description |
---|---|
bool |
Overrides
Exceptions
Type | Condition |
---|---|
ValidationException | The data field value was null. |