src/EntityFramework/Core/Objects/DataClasses/EntityCollection.cs
/// <summary>
///     Add the item to the underlying collection
/// </summary>
/// <param name="entity"> </param>
Add the item to the underlying collection
Add the item to the underlying collection
internal override void DisconnectedAdd(IEntityWrapper wrappedEntity)
        {
            DebugCheck.NotNull(wrappedEntity);
            if (null != wrappedEntity.Context
                && wrappedEntity.MergeOption != MergeOption.NoTracking)
            {
                throw new InvalidOperationException(Strings.RelatedEnd_UnableToAddEntity);
            }
            VerifyType(wrappedEntity);
            AddToCache(wrappedEntity,  false);
            OnAssociationChanged(CollectionChangeAction.Add, wrappedEntity.Entity);
        }
internal override void DisconnectedAdd ( IEntityWrapper wrappedEntity ) { DebugCheck . NotNull ( wrappedEntity ) ; if ( null != wrappedEntity . Context && wrappedEntity . MergeOption != MergeOption . NoTracking ) { throw new InvalidOperationException ( Strings . RelatedEnd_UnableToAddEntity ) ; } VerifyType ( wrappedEntity ) ; AddToCache ( wrappedEntity , false ) ; OnAssociationChanged ( CollectionChangeAction . Add , wrappedEntity . Entity ) ; }
Add the item to the underlying collection
Add the item to the underlying collection
// Validate that the incoming entity is also detached // Add the entity to local collection without doing any fixup /* applyConstraints */
wrappedEntity
IEntityWrapper
entity
None