Guest User

Untitled

a guest
Oct 25th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. using (var ctx = new CustomerContext())
  2. {
  3. // 1. SPLIT the queries in multiple smaller queries
  4. var customers = ctx.Customers
  5. .Include(x => x.Orders.Select(y => y.Items.Select(z => z.Product))
  6. .ToList();
  7.  
  8. var customers = ctx.Customers
  9. .Include(x => x.Payments.Select(y => y.Items)
  10. .ToList();
  11.  
  12. var customers = ctx.Customers
  13. .Include(x => x.Shippings.Select(y => y.Items)
  14. .ToList();
  15.  
  16. // 2. Done!
  17. }
Add Comment
Please, Sign In to add comment