MSDN Library

DataServiceContext.Detach Method

Removes the entity from the list of entities that the DataServiceContext is tracking.

Namespace:  System.Data.Services.Client
Assembly:  Microsoft.Data.Services.Client (in Microsoft.Data.Services.Client.dll)

public bool Detach(
	Object entity


Type: System.Object
The tracked entity to be detached from the DataServiceContext.

Return Value

Type: System.Boolean
Returns true if the specified entity was detached; otherwise false.


When entity is null.

Once an object is detached, it is no longer tracked by the DataServiceContext.

The Detach method can be called to detach any object, regardless of its EntityStates.

After detaching the specified entity, this method also detaches any links related to the entity.

© 2016 Microsoft