Export (0) Print
Expand All

DbSet<TEntity>.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 TEntity Remove(
	TEntity entity
)

Parameters

entity
Type: TEntity

The entity to remove.

Return Value

Type: TEntity
Returns DbSet.

Implements

IDbSet<TEntity>.Remove(TEntity)

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

Show:
© 2014 Microsoft