Table of contents
ValidateLengthAttribute API Document
Validate that this property has the required length (either exact or in range)
Constructors
ValidateLengthAttribute(Int32 exactLength)
Initializes a new exact length validator.
| Parameter | Description |
|---|---|
| exactLength | The exact length required. |
ValidateLengthAttribute(Int32 exactLength, String errorMessage)
Initializes a new exact length validator.
| Parameter | Description |
|---|---|
| exactLength | The exact length required. |
| errorMessage | The error message to be displayed if the validation fails. |
ValidateLengthAttribute(Int32 minLength, Int32 maxLength)
Initializes a new range based length validator.
| Parameter | Description |
|---|---|
| minLength | The minimum length, or int.MinValue if this should not be tested. |
| maxLength | The maximum length, or int.MaxValue if this should not be tested. |
ValidateLengthAttribute(Int32 minLength, Int32 maxLength, String errorMessage)
Initializes a new range based length validator.
| Parameter | Description |
|---|---|
| minLength | The minimum length, or int.MinValue if this should not be tested. |
| maxLength | The maximum length, or int.MaxValue if this should not be tested. |
| errorMessage | The error message to be displayed if the validation fails. |
Properties
| Name | Type | Description |
|---|---|---|
| Validator | IValidator | Gets the validator for this attribute. Each attribute that inherits from this class will have its own validtor. |