Class OptionalStringLengthAttribute
Specifies the minimum and maximum length of characters that are allowed in a data field of type Optional<T>.
Inheritance
OptionalStringLengthAttribute
Inherited Members
Namespace: DotNext.ComponentModel.DataAnnotations
Assembly: DotNext.dll
Syntax
public sealed class OptionalStringLengthAttribute : StringLengthAttribute
Remarks
Initializes a new attribute.
Constructors
| Edit this page View SourceOptionalStringLengthAttribute(int)
Specifies the minimum and maximum length of characters that are allowed in a data field of type Optional<T>.
Declaration
public OptionalStringLengthAttribute(int maximumLength)
Parameters
Type | Name | Description |
---|---|---|
int | maximumLength | The maximum length of a string. |
Remarks
Initializes a new attribute.
Methods
| Edit this page View SourceIsValid(object?)
Determines whether a specified object is valid.
Declaration
public override bool IsValid(object? value)
Parameters
Type | Name | Description |
---|---|---|
object | value | The object to validate. |
Returns
Type | Description |
---|---|
bool |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
-or-
|
InvalidOperationException | The current attribute is ill-formed. |