src/Shared/EntityFramework/Core/Objects/DataClasses/EntityCollection.cs
/// <summary>Defines a relationship between two attached objects in an object context.</summary>
/// <param name="entity">The object being attached.</param>
/// <exception cref="T:System.ArgumentNullException">When the  entity  is null.</exception>
/// <exception cref="T:System.InvalidOperationException">
/// When the  entity  cannot be related to the source object. This can occur when the association in the conceptual schema does not support a relationship between the two types.-or-When either object 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.
/// </exception>
Defines a relationship between two attached objects in an object context.
Defines a relationship between two attached objects in an object context .
public void Attach(TEntity entity)
        {
            Check.NotNull(entity, "entity");
            Attach(new[] { EntityWrapperFactory.WrapEntityUsingContext(entity, ObjectContext) }, false);
        }
public void Attach ( TEntity entity ) { Check . NotNull ( entity , " " ) ; Attach ( new [ ] { EntityWrapperFactory . WrapEntityUsingContext ( entity , ObjectContext ) } , false ) ; }
Defines a relationship between two attached objects in an object context.
Defines a relationship between two attached objects in an object context .
When the  entity  is null.
When the entity is null .
When the  entity  cannot be related to the source object. This can occur when the association in the conceptual schema does not support a relationship between the two types.-or-When either object is null or is not in an

or  state.
When the entity cannot be related to the source object . This can occur when the association in the conceptual schema does not support a relationship between the two types . - or - When either object is null or is not in an or state .
entity
TEntity
The object being attached.
The object being attached .