ObjectSet<TEntity>.Detach Method (TEntity)

 

Removes the object from the object context.

Namespace:   System.Data.Entity.Core.Objects
Assembly:  EntityFramework (in EntityFramework.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.