ConventionPropertyExtensions.SetMaxLength Methode

Definition

Legt die maximale Länge von Daten fest, die in dieser Eigenschaft zulässig ist. Wenn die Eigenschaft beispielsweise ein String ist, ist dies die maximale Anzahl von Zeichen.

public static void SetMaxLength (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, int? maxLength, bool fromDataAnnotation = false);
public static int? SetMaxLength (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, int? maxLength, bool fromDataAnnotation = false);
static member SetMaxLength : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * Nullable<int> * bool -> unit
static member SetMaxLength : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * Nullable<int> * bool -> Nullable<int>
<Extension()>
Public Sub SetMaxLength (property As IConventionProperty, maxLength As Nullable(Of Integer), Optional fromDataAnnotation As Boolean = false)
<Extension()>
Public Function SetMaxLength (property As IConventionProperty, maxLength As Nullable(Of Integer), Optional fromDataAnnotation As Boolean = false) As Nullable(Of Integer)

Parameter

property
IConventionProperty

Die Eigenschaft, die die maximale Länge von festlegen soll.

maxLength
Nullable<Int32>

Die maximale Datenlänge, die in dieser Eigenschaft zulässig ist.

fromDataAnnotation
Boolean

Gibt an, ob die Konfiguration mithilfe einer Datenanmerkung angegeben wurde.

Gibt zurück

Die konfigurierte Eigenschaft.

Gilt für: