Guest User

Untitled

a guest
Feb 17th, 2019
103
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 context = new SuperMarketContext())
  2. {
  3. var product = context.Product
  4. .Include(p => p.Orders)
  5. .Where(p => p.Id == 5002)
  6. .First();
  7.  
  8. context.Entry(product)
  9. .Collection(p => p.Orders)
  10. .Query()
  11. .Where(o => o.Total > 10)
  12. .Load();
  13.  
  14. foreach (var item in product.Orders)
  15. {
  16. Console.WriteLine(item);
  17. }
  18. }
Add Comment
Please, Sign In to add comment