I have the following code:
List<T> list = new List<T>();
IEnumerable<T> query1 = ...
IEnumerable<T> query2 = ...
IEnumerable<T> query3 = ...
list.AddRange(query1.ToList<T>());
list.AddRange(query2.ToList<T>());
list.AddRange(query3.ToList<T>());
As far as I'm aware this will cause a trip to the database each time the ToList method is used on a query.
How would I combine the queries so that only one trip is made to the database?