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

ObjectSet<TEntity>.Detach Method

.NET Framework 4.6 and 4.5

Removes the object from the object context.

Namespace:  System.Data.Objects
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

public void Detach(
	TEntity entity
)

Parameters

entity
Type: TEntity

Object to be detached. Only the entity is removed; if there are any related objects that are being tracked by the same ObjectStateManager, those will not be detached automatically.

Implements

IObjectSet<TEntity>.Detach(TEntity)

This method is a wrapper around the Detach method.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft