ConventionPropertyExtensions.SetBeforeSaveBehavior Méthode

Définition

Définit une valeur indiquant si cette propriété peut être modifiée avant l’enregistrement de l’entité dans la base de données.

Si Throwla valeur est , une exception est levée si une valeur est affectée à cette propriété lorsqu’elle est dans l’état Added .

Si Ignorela valeur est , tout jeu de valeurs est ignoré lorsqu’il est dans l’état Added .

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

Paramètres

property
IConventionProperty

Propriété.

beforeSaveBehavior
Nullable<PropertySaveBehavior>

Valeur indiquant si cette propriété peut être modifiée avant l’enregistrement de l’entité dans la base de données. null pour rétablir la valeur par défaut.

fromDataAnnotation
Boolean

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

Retours

Valeur configurée.

S’applique à