語言

MutablePropertyExtensions.SetAfterSaveBehavior 方法

定義

取得或設定一個值,指示該屬性在實體儲存到資料庫後是否能被修改。

若 Throw,則在該實體存在於資料庫後,若該屬性被賦予新值,則會拋出例外。

若 Ignore,則資料庫中已存在的實體屬性值任何修改將被忽略。

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

參數

property
IMutableProperty

屬性。

afterSaveBehavior
Nullable<PropertySaveBehavior>

一個表示該屬性在實體儲存到資料庫後是否能被修改的值。

適用於