語言

IUpdateEntry 介面

定義

資訊會傳遞給資料庫提供者,以將實體的變更儲存到資料庫中。

此介面通常由資料庫提供者(及其他擴充)使用。 它通常不被用於應用程式程式碼中。

public interface IUpdateEntry
type IUpdateEntry = interface
Public Interface IUpdateEntry

備註

更多資訊與範例請參見 資料庫提供者與擴充功能的實作 。

屬性

名稱 Description
Context

DbContext電流正在使用。

EntityState

要拯救的實體狀態。

EntityType

要儲存到資料庫的實體類型。

SharedIdentityEntry

另一個擁有相同鍵值的條目(如果存在的話)。

方法

名稱 Description
CanHaveOriginalValue(IPropertyBase)

只有當該房產有原始價值的儲存空間時,才會退還 true 。

GetCurrentValue(IPropertyBase)

取得該物業所分配的價值。

GetCurrentValue<TProperty>(IPropertyBase)

取得該物業所分配的價值。

GetOriginalValue(IPropertyBase)

會取得從資料庫取得屬性時分配給該屬性的值。

GetOriginalValue<TProperty>(IProperty)

會取得從資料庫取得屬性時分配給該屬性的值。

GetPreStoreGeneratedCurrentValue(IPropertyBase)

在任何商店產生的值被套用之前,先取得該屬性的值。

GetRelationshipSnapshotValue(IPropertyBase)

取得外鍵或主鍵中最後分配給屬性的值

HasExplicitValue(IProperty)

會得到一個值,表示指定屬性是否有明確的值集合。

HasStoreGeneratedValue(IProperty)

取得一個值,表示該屬性是否有尚未儲存到實體的儲存產生值。

HasTemporaryValue(IProperty)

會獲得一個值,表示指定屬性是否有暫時值。

IsConceptualNull(IProperty)

檢查該屬性在概念上是否被設定為 null,即使該屬性類型不可為空。

IsLoaded(IProperty)

會取得一個值,表示該屬性是否已載入。 若 false,則該屬性值未從資料庫讀取,該屬性應排除於更新操作之外。

IsModified(IComplexProperty)

會得到一個值,表示指定的複數性質是否被修改。 若 true,則應將該屬性目前的值儲存到資料庫中。

IsModified(IProperty)

會得到一個值,表示指定屬性是否被修改。 若 true,則應將該屬性目前的值儲存到資料庫中。

IsStoreGenerated(IProperty)

會取得一個值,指示指定的屬性是否應該由資料庫產生值。

SetCurrentValue(IPropertyBase, Object)

將給定的數值指派給該物業。

SetOriginalValue(IProperty, Object)

設定給定屬性的原始值。

SetPropertyModified(IProperty)

標記給定屬性為修改過。

SetStoreGeneratedValue(IProperty, Object, Boolean)

為該物業指派一個商店產生的價值。

SetStoreGeneratedValue(IProperty, Object)

為該物業指派一個商店產生的價值。

ToEntityEntry()

被拯救的實體會獲得一個 EntityEntry 。 EntityEntry 是一個為應用程式開發者優化的 API,也 IUpdateEntry 針對資料庫提供者優化,但有時資料庫提供者可能會想從 中存取資訊 EntityEntry。

擴充方法

名稱 Description
BuildCurrentValuesString(IUpdateEntry, IEnumerable<IPropertyBase>)

建立格式化的字串表示,呈現給定屬性及其當前值,例如在拋出使用該屬性的鍵、索引等例外時非常有用。

BuildOriginalValuesString(IUpdateEntry, IEnumerable<IPropertyBase>)

建立格式化的字串表示,呈現給定屬性及其原始值,例如在拋出使用該屬性的鍵、索引等例外時非常有用。

GetCurrentProviderValue(IUpdateEntry, IProperty)

取得該屬性所指派的值,並將其轉換為提供者期望值。

GetOriginalProviderValue(IUpdateEntry, IProperty)

取得原始分配給屬性的值,並將其轉換為提供者期望值。

ToDebugString(IUpdateEntry, ChangeTrackerDebugStringOptions, Int32)

建立一個人類可讀的給定 IUpdateEntry表示。

警告:請勿依賴回傳字串的格式。 它僅設計用於除錯,且可能在不同版本間任意變動。

適用於