How would you do this (pseudo code): product1.Orders.AddRange(product2.Orders);
However, the function \"AddRange\" does not exist, so how would you copy all items in the
Based on the previous two answers, I came up with the following working solution:
public static void AddRange(this EntityCollection destinationEntityCollection,
EntityCollection sourceEntityCollection) where T : class
{
var array = new T[sourceEntityCollection.Count()];
sourceEntityCollection.CopyTo(array,0);
foreach (var entity in array)
{
destinationEntityCollection.Add(entity);
}
}