ConventionPropertyExtensions.SetBeforeSaveBehavior(IConventionProperty, Nullable<PropertySaveBehavior>, Boolean) Yöntem

Tanım

Varlık veritabanına kaydedilmeden önce bu özelliğin değiştirilip değiştirilemeyeceğini gösteren değeri ayarlar.

İse Throw , bu özelliğe bir değer olduğunda bir değer atanırsa bir özel durum oluşturulur Added .

İse Ignore , durumunda herhangi bir değer kümesi yok sayılır 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)

Parametreler

property
IConventionProperty

Özellik.

beforeSaveBehavior
Nullable<PropertySaveBehavior>

Varlık veritabanına kaydedilmeden önce bu özelliğin değiştirilip değiştirimeyeceğini belirten bir değer. null varsayılana sıfırlayın.

fromDataAnnotation
Boolean

Yapılandırmanın bir veri ek açıklaması kullanılarak mı belirtilmediğini belirtir.

Döndürülenler

Nullable<PropertySaveBehavior>

Yapılandırılan değer.

Şunlara uygulanır