MaxLengthAttribute Constructors

Definition

Initializes a new instance of the MaxLengthAttribute class.

Overloads

MaxLengthAttribute()

Initializes a new instance of the MaxLengthAttribute class.

MaxLengthAttribute(Int32)

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

MaxLengthAttribute()

Source:
MaxLengthAttribute.cs
Source:
MaxLengthAttribute.cs
Source:
MaxLengthAttribute.cs

Initializes a new instance of the MaxLengthAttribute class.

C#
public MaxLengthAttribute();

Remarks

The maximum allowable length supported by the database will be used.

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0

MaxLengthAttribute(Int32)

Source:
MaxLengthAttribute.cs
Source:
MaxLengthAttribute.cs
Source:
MaxLengthAttribute.cs

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

C#
public MaxLengthAttribute(int length);

Parameters

length
Int32

The maximum allowable length of array or string data.

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0