O'Reilly logo
  • Pierre Ouimet thinks this is interesting:

Sometimes you want to load all related records. For example, if you absolutely knew you needed all Orders and all Cars, you could change the previous code to this:

using (var context = new AutoLotEntities())
  foreach (Car c in context.Cars.Include(c=>c.Orders))


Cover of C# 6.0 and the .NET 4.6 Framework, Seventh Edition


Doesn’t look this is working …