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.
public virtual Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry<TEntity> Remove (TEntity entity);
abstract member Remove : 'Entity -> Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry<'Entity (requires 'Entity : null)> override this.Remove : 'Entity -> Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry<'Entity (requires 'Entity : null)>
Public Overridable Function Remove (entity As TEntity) As EntityEntry(Of TEntity)
The entity to remove.
The EntityEntry<TEntity> for the entity. The entry provides access to change tracking information and operations for the entity.
If the entity is already tracked in the Added state then the context will stop tracking the entity (rather than marking it as Deleted) since the entity was previously added to the context and does not exist in the database.
Any other reachable entities that are not already being tracked will be tracked in the same way that they would be if Attach(TEntity) was called before calling this method. This allows any cascading actions to be applied when SaveChanges() is called.
Use State to set the state of only a single entity.
See EF Core change tracking for more information.
Submit and view feedback for