System.ComponentModel.DataAnnotations.StringLengthAttribute
Specifies the minimum and maximum length of characters that are allowed in a data field.
namespace System.ComponentModel.DataAnnotations
{
public class StringLengthAttribute : ValidationAttribute
{
public int MaximumLength { get; }
public int MinimumLength { get; set; }
public StringLengthAttribute(int maximumLength);
}
}