Edit

Share via


DataServiceContext.Detach(Object) Method

Definition

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

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

Parameters

entity
Object

The tracked entity to be detached from the DataServiceContext.

Returns

Returns true if the specified entity was detached; otherwise false.

Exceptions

When entity is null.

Remarks

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.

Applies to