Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (var context = new SuperMarketContext())
- {
- var product = context.Product
- .Include(p => p.Orders)
- .Where(p => p.Id == 5002)
- .First();
- context.Entry(product)
- .Collection(p => p.Orders)
- .Query()
- .Where(o => o.Total > 10)
- .Load();
- foreach (var item in product.Orders)
- {
- Console.WriteLine(item);
- }
- }
Add Comment
Please, Sign In to add comment