Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Detach Method

DataServiceContext.Detach Method

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

Namespace:  System.Data.Services.Client
Assembly:  System.Data.Services.Client (in System.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.

After an entity is detached, it is unaffected by operations in the DataServiceContext.

Any entity being tracked by the DataServiceContext, whether in the added, modified, deleted, or unchanged state, the entity may be detached.

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


Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

© 2015 Microsoft