共用方式為


ObjectContext.Attach(IEntityWithKey) 方法

定義

當物件具有實體索引鍵時,將物件或物件圖形附加至物件內容。

public virtual void Attach (System.Data.Entity.Core.Objects.DataClasses.IEntityWithKey entity);
abstract member Attach : System.Data.Entity.Core.Objects.DataClasses.IEntityWithKey -> unit
override this.Attach : System.Data.Entity.Core.Objects.DataClasses.IEntityWithKey -> unit
Public Overridable Sub Attach (entity As IEntityWithKey)

參數

entity
IEntityWithKey

要附加的物件。

例外狀況

entity 是 null。

無效的實體索引鍵。

適用於