ObjectSet<TEntity>.Detach Method (TEntity)

.NET Framework (current version)
 
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 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.

This method is a wrapper around the Detach method.

.NET Framework
Available since 4.0
Return to top
Show: