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。

无效的实体键。

适用于