src/EntityFramework/Core/Objects/DataClasses/EntityCollection.cs
/// <summary>
///     Remove the item from the underlying collection
/// </summary>
/// <param name="entity"> </param>
/// <param name="applyConstraints"> </param>
Remove the item from the underlying collection
Remove the item from the underlying collection
internal override bool DisconnectedRemove(IEntityWrapper wrappedEntity)
        {
            DebugCheck.NotNull(wrappedEntity);
            if (null != wrappedEntity.Context
                && wrappedEntity.MergeOption != MergeOption.NoTracking)
            {
                throw new InvalidOperationException(Strings.RelatedEnd_UnableToRemoveEntity);
            }
            var result = RemoveFromCache(wrappedEntity,  false,  false);
            OnAssociationChanged(CollectionChangeAction.Remove, wrappedEntity.Entity);
            return result;
        }
internal override bool DisconnectedRemove ( IEntityWrapper wrappedEntity ) { DebugCheck . NotNull ( wrappedEntity ) ; if ( null != wrappedEntity . Context && wrappedEntity . MergeOption != MergeOption . NoTracking ) { throw new InvalidOperationException ( Strings . RelatedEnd_UnableToRemoveEntity ) ; } var result = RemoveFromCache ( wrappedEntity , false , false ) ; OnAssociationChanged ( CollectionChangeAction . Remove , wrappedEntity . Entity ) ; return result ; }
Remove the item from the underlying collection
Remove the item from the underlying collection
// Validate that the incoming entity is also detached // Remove the entity to local collection without doing any fixup /* resetIsLoaded*/ /*preserveForeignKey*/
wrappedEntity
IEntityWrapper
entity
None
applyConstraints
None