public static void Attach <T>(this ICollection <T> iCollection, IEnumerable <T> entities) where T : class { EntityCollection <T> entityCollection = iCollection as EntityCollection <T>; if (entityCollection == null || entities == null) { throw new ArgumentNullException(); } entityCollection.Attach(entities); }
public static ObjectQuery <T> Attach <T>(this ICollection <T> iCollection) where T : class { EntityCollection <T> entityCollection = iCollection as EntityCollection <T>; if (entityCollection == null) { throw new ArgumentNullException(); } return(entityCollection.Attach()); }