Share via


EntityCollection<TEntity>.Remove(TEntity) Method

Definition

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