src/Shared/EntityFramework/DbSet.cs
/// <summary>
/// Marks the given entity as Deleted such that it will be deleted from the database when SaveChanges
/// is called.  Note that the entity must exist in the context in some other state before this method
/// is called.
/// </summary>
/// <param name="entity"> The entity to remove. </param>
/// <returns> The entity. </returns>
/// <remarks>
/// Note that if the entity exists in the context in the Added state, then this method
/// will cause it to be detached from the context.  This is because an Added entity is assumed not to
/// exist in the database such that trying to delete it does not make sense.
/// </remarks>
Marks the given entity as Deleted such that it will be deleted from the database when SaveChanges
is called.  Note that the entity must exist in the context in some other state before this method
is called.
Marks the given entity as Deleted such that it will be deleted from the database when SaveChanges is called . Note that the entity must exist in the context in some other state before this method is called .
public virtual object Remove(object entity)
        {
            Check.NotNull(entity, "entity");
            GetInternalSetWithCheck("Remove").Remove(entity);
            return entity;
        }
public virtual object Remove ( object entity ) { Check . NotNull ( entity , " " ) ; GetInternalSetWithCheck ( " " ) . Remove ( entity ) ; return entity ; }
Marks the given entity as Deleted such that it will be deleted from the database when SaveChanges
is called.
Marks the given entity as Deleted such that it will be deleted from the database when SaveChanges is called .
None
entity
object
The entity to remove.
The entity to remove .
remarks
Note that if the entity exists in the context in the Added state, then this method
will cause it to be detached from the context.  This is because an Added entity is assumed not to
exist in the database such that trying to delete it does not make sense.
Note that if the entity exists in the context in the Added state then this method will cause it to be detached from the context . This is because an Added entity is assumed not to exist in the database such that trying to delete it does not make sense .