DataServiceContext.Detach(Object) 方法

定义

从要跟踪的实体列表中删除实体 DataServiceContext

public:
 bool Detach(System::Object ^ entity);
public bool Detach(object entity);
member this.Detach : obj -> bool
Public Function Detach (entity As Object) As Boolean

参数

entity
Object

要从中分离的 DataServiceContext跟踪实体。

返回

如果已分离指定的实体,则返回 true ;否则 false返回 。

例外

何时 entitynull

注解

分离对象后,不再由该对象 DataServiceContext跟踪。

Detach可以调用该方法来分离任何对象,而不考虑其EntityStates任何对象。

分离指定实体后,此方法还会分离与实体相关的任何链接。

适用于