IIdentityResolutionInterceptor.UpdateTrackedInstance 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當 a DbContext 嘗試追蹤一個實體的新實例,其主鍵值與已追蹤的實例相同時,會被呼叫。 此方法必須將新實例中的任何屬性值與關係變更套用到現有實例中。 新實例隨後被丟棄。
public void UpdateTrackedInstance(Microsoft.EntityFrameworkCore.Diagnostics.IdentityResolutionInterceptionData interceptionData, Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry existingEntry, object newEntity);
abstract member UpdateTrackedInstance : Microsoft.EntityFrameworkCore.Diagnostics.IdentityResolutionInterceptionData * Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry * obj -> unit
Public Sub UpdateTrackedInstance (interceptionData As IdentityResolutionInterceptionData, existingEntry As EntityEntry, newEntity As Object)
參數
- interceptionData
- IdentityResolutionInterceptionData
關於身份解析的上下文資訊。
- existingEntry
- EntityEntry
這是現有追蹤實體實例的條目。
- newEntity
- Object
這個新的實體實例,會在這次呼叫後被丟棄。