Guest User

Untitled

a guest
Jul 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. public class Product
  2. {
  3. public int ProductID { get; set; }
  4. public string ProductName { get; set; }
  5. public string Category { get; set; }
  6. public decimal UnitPrice { get; set; }
  7. public int UnitsInStock { get; set; }
  8. }
  9.  
  10. public class Order
  11. {
  12. public int OrderID { get; set; }
  13. public DateTime OrderDate { get; set; }
  14. public decimal Total { get; set; }
  15. }
  16.  
  17. var customers = (from c in dataSource.Customers
  18. from o in c.Orders
  19. where o.Total > value
  20. select c).Distinct();
  21.  
  22. var customers = dataSource.Customers.Select(c => c.Orders
  23. .Where(o => o.Total > value))
  24. .Distinct();
Add Comment
Please, Sign In to add comment