Export (0) Print
Expand All

DbSet.Remove Method

Entity Framework 5.0

Marks the given entity as Deleted. When the changes are saved, the entity is deleted from the database. The entity must exist in the context in some other state before this method is called.

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

public Object Remove(
	Object entity


Type: System.Object

The entity to remove.

Return Value

Type: System.Object
The entity.

If the entity exists in the context in the Added state, then this method will cause it to be detached from the context.

© 2015 Microsoft