ObjectSet<TEntity>.Attach 方法

[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]

将对象或对象图附加到当前实体集中的对象上下文。

命名空间:  System.Data.Entity.Core.Objects
程序集:  EntityFramework(在 EntityFramework.dll 中)

语法

声明
Public Sub Attach ( _
    entity As TEntity _
)
用法
Dim instance As ObjectSet 
Dim entity As TEntity

instance.Attach(entity)
public void Attach(
    TEntity entity
)
public:
virtual void Attach(
    TEntity entity
) sealed
abstract Attach : 
        entity:'TEntity -> unit  
override Attach : 
        entity:'TEntity -> unit
public final function Attach(
    entity : TEntity
)

参数

  • entity
    类型:TEntity
    要附加的对象。

Implements

IObjectSet<TEntity>.Attach(TEntity)

请参阅

参考

ObjectSet<TEntity> 类

System.Data.Entity.Core.Objects 命名空间