Share via


IConventionElementTypeBuilder.HasMaxLength Method

Definition

Configures the maximum length of data that can be stored in elements of the collection.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionElementTypeBuilder? HasMaxLength (int? maxLength, bool fromDataAnnotation = false);
abstract member HasMaxLength : Nullable<int> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionElementTypeBuilder
Public Function HasMaxLength (maxLength As Nullable(Of Integer), Optional fromDataAnnotation As Boolean = false) As IConventionElementTypeBuilder

Parameters

maxLength
Nullable<Int32>

The maximum length of data allowed in elements of the collection. A value of -1 indicates that elements of the collection have no maximum length.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Applies to