<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0-preview.4.20251.6" />

System.ComponentModel.DataAnnotations.MaxLengthAttribute

Specifies the maximum length of array or string data allowed in a property.
public int Length { get; }

Gets the maximum allowable length of the array or string data.

public MaxLengthAttribute(int length)

Initializes a new instance of the MaxLengthAttribute class based on the length parameter.

Initializes a new instance of the MaxLengthAttribute class.