ConventionPropertyExtensions.SetBeforeSaveBehavior Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Imposta un valore che indica se questa proprietà può essere modificata prima che l'entità venga salvata nel database.
Se Throw, verrà generata un'eccezione se a questa proprietà viene assegnato un valore quando si trova nello Added stato .
Se Ignore, qualsiasi set di valori verrà ignorato quando si trova nello Added stato .
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)
Parametri
- property
- IConventionProperty
Proprietà .
- beforeSaveBehavior
- Nullable<PropertySaveBehavior>
Valore che indica se questa proprietà può essere modificata prima che l'entità venga salvata nel database.
null per ripristinare l'impostazione predefinita.
- fromDataAnnotation
- Boolean
Indica se la configurazione è stata specificata utilizzando un'annotazione dati.
Valori restituiti
Valore configurato.