MutablePropertyExtensions.SetBeforeSaveBehavior 方法

定義

取得或設定值,指出在實體儲存至資料庫之前,是否可以修改此屬性。

如果為 Throw ,則在狀態中 Added 時,如果值指派給這個屬性,則會擲回例外狀況。

如果 Ignore 為 ,則會在處於 狀態時 Added 忽略任何設定的值。

public static void SetBeforeSaveBehavior (this Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property, Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior? beforeSaveBehavior);
static member SetBeforeSaveBehavior : Microsoft.EntityFrameworkCore.Metadata.IMutableProperty * Nullable<Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior> -> unit
<Extension()>
Public Sub SetBeforeSaveBehavior (property As IMutableProperty, beforeSaveBehavior As Nullable(Of PropertySaveBehavior))

參數

property
IMutableProperty

屬性。

beforeSaveBehavior
Nullable<PropertySaveBehavior>

值,指出實體儲存至資料庫之前,是否可以修改這個屬性。

適用於