EntityCollection<TEntity>.Remove Method (TEntity)
Removes an object from the collection and marks the relationship for deletion.
Assembly: EntityFramework (in EntityFramework.dll)
Parameters
- item
-
Type:
TEntity
The object to remove from the collection.
Implements
ICollection<T>.Remove(T)Exception | Condition |
---|---|
ArgumentNullException | entity object is null. |
InvalidOperationException | The entity object is not attached to the same object context.-or-The entity object does not have a valid relationship manager. |