LocalView<TEntity>.Remove(TEntity) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Marks the given entity as Deleted.
public virtual bool Remove (TEntity item);
abstract member Remove : 'Entity -> bool
override this.Remove : 'Entity -> bool
Public Overridable Function Remove (item As TEntity) As Boolean
Parameters
- item
- TEntity
The entity to delete.
Returns
true
if the entity was being tracked and was not already Deleted.
Implements
Remarks
Entities that are currently marked as Added will be marked as Detached since the Added state indicates that the entity has not been saved to the database and hence it does not make sense to attempt to delete it from the database.
See Local views of tracked entities in EF Core for more information and examples.
Applies to
Entity Framework