ConventionPropertyExtensions.SetMaxLength Méthode

Définition

Définit la longueur maximale des données autorisées dans cette propriété. Par exemple, si la propriété est un String ' , il s’agit du nombre maximal de caractères.

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)

Paramètres

property
IConventionProperty

Propriété dont la longueur maximale doit être définie.

maxLength
Nullable<Int32>

Longueur maximale des données autorisée dans cette propriété.

fromDataAnnotation
Boolean

Indique si la configuration a été spécifiée à l’aide d’une annotation de données.

Retours

Propriété configurée.

S’applique à