<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0-rc.1.20451.14" />

System.ComponentModel.DataAnnotations.MaxLengthAttribute

Specifies the maximum length of array or string data allowed in a property.
namespace System.ComponentModel.DataAnnotations { public class MaxLengthAttribute : ValidationAttribute { public int Length { get; } public MaxLengthAttribute(int length); public MaxLengthAttribute(); } }