DataServiceContext.Detach Method (Object)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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
)

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.

Exception Condition
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.

.NET Framework
Available since 3.5
Silverlight
Available since 2.0
Return to top
Show: