IConventionPropertyBuilder.HasMaxLength Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Configure la longueur maximale des données qui peuvent être stockées dans cette propriété.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasMaxLength(int? maxLength, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder HasMaxLength(int? maxLength, bool fromDataAnnotation = false);
abstract member HasMaxLength : Nullable<int> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function HasMaxLength (maxLength As Nullable(Of Integer), Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder
Paramètres
Longueur maximale des données autorisées dans la propriété. Une valeur indiquant -1 que la propriété n’a pas de longueur maximale.
- fromDataAnnotation
- Boolean
Indique si la configuration a été spécifiée à l’aide d’une annotation de données.
Retours
La même instance de générateur si la configuration a été appliquée, null sinon.