System.ComponentModel.DataAnnotations.StringLengthAttribute
Specifies the minimum and maximum length of characters that are allowed in a data field.
Gets or sets the maximum length of a string.
Gets or sets the minimum length of a string.
Initializes a new instance of the StringLengthAttribute class by using a specified maximum length.