You have two options:
(1) Use int.MaxLength as the maximumLength argument of the StringLengthAttribute constructor:
[Required] [StringLength(int.MaxValue, MinimumLength = 3)] public string Body { get; set; }
(2) Decorate the property additionally with MaxLengthAttribute w / o parameters ( StringLengthAttribute value will be ignored):
[Required] [StringLength(100, MinimumLength = 3)] [MaxLength] public string Body { get; set; }
source share