src/Shared/EntityFramework/Core/Objects/DataClasses/EntityCollection.cs
/// <summary>Defines relationships between an object and a collection of related objects in an object context.</summary>
/// <remarks>
/// Loads related entities into the local collection. If the collection is already filled
/// or partially filled, merges existing entities with the given entities. The given
/// entities are not assumed to be the complete set of related entities.
/// Owner and all entities passed in must be in Unchanged or Modified state. We allow
/// deleted elements only when the state manager is already tracking the relationship
/// instance.
/// </remarks>
/// <param name="entities">Collection of objects in the object context that are related to the source object.</param>
/// <exception cref="T:System.ArgumentNullException"> entities  collection is null.</exception>
/// <exception cref="T:System.InvalidOperationException">
/// The source object or an object in the  entities  collection is null or is not in an
/// <see
///     cref="F:System.Data.Entity.EntityState.Unchanged" />
/// or <see cref="F:System.Data.Entity.EntityState.Modified" /> state.-or-The relationship cannot be defined based on the EDM metadata. This can occur when the association in the conceptual schema does not support a relationship between the two types.
/// </exception>
Defines relationships between an object and a collection of related objects in an object context.
Defines relationships between an object and a collection of related objects in an object context .
public void Attach(IEnumerable<TEntity> entities)
        {
            Check.NotNull(entities, "entities");
            CheckOwnerNull();
            IList<IEntityWrapper> wrappedEntities = new List<IEntityWrapper>();
            foreach (var entity in entities)
            {
                wrappedEntities.Add(EntityWrapperFactory.WrapEntityUsingContext(entity, ObjectContext));
            }
            Attach(wrappedEntities, true);
        }
public void Attach ( IEnumerable < TEntity > entities ) { Check . NotNull ( entities , " " ) ; CheckOwnerNull ( ) ; IList < IEntityWrapper > wrappedEntities = new List < IEntityWrapper > ( ) ; foreach ( var entity in entities ) { wrappedEntities . Add ( EntityWrapperFactory . WrapEntityUsingContext ( entity , ObjectContext ) ) ; } Attach ( wrappedEntities , true ) ; }
Defines relationships between an object and a collection of related objects in an object context.
Defines relationships between an object and a collection of related objects in an object context .
entities  collection is null.
entities collection is null .
The source object or an object in the  entities  collection is null or is not in an

or  state.-or-The relationship cannot be defined based on the EDM metadata. This can occur when the association in the conceptual schema does not support a relationship between the two types.
The source object or an object in the entities collection is null or is not in an or state . - or - The relationship cannot be defined based on the EDM metadata . This can occur when the association in the conceptual schema does not support a relationship between the two types .
entities
IEnumerable<TEntity>
Collection of objects in the object context that are related to the source object.
Collection of objects in the object context that are related to the source object .
remarks
Loads related entities into the local collection. If the collection is already filled
or partially filled, merges existing entities with the given entities. The given
entities are not assumed to be the complete set of related entities.
Owner and all entities passed in must be in Unchanged or Modified state. We allow
deleted elements only when the state manager is already tracking the relationship
instance.
Loads related entities into the local collection . If the collection is already filled or partially filled merges existing entities with the given entities . The given entities are not assumed to be the complete set of related entities . Owner and all entities passed in must be in Unchanged or Modified state . We allow deleted elements only when the state manager is already tracking the relationship instance .