EntityCollection<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.
Removes an object from the collection and marks the relationship for deletion.
public bool Remove (TEntity item);
override this.Remove : 'Entity -> bool
Public Function Remove (item As TEntity) As Boolean
Parameters
- item
- TEntity
The object to remove from the collection.
Returns
true if item was successfully removed; otherwise, false.
Implements
Exceptions
entity object is null.
The entity object is not attached to the same object context.-or-The entity object does not have a valid relationship manager.
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework