Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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
)

Parameters

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.

ExceptionCondition
ArgumentNullException

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.

Show:
© 2015 Microsoft