Find all customers whose purchase is less than 10000
var Customer = from c in _NorthWindDataContext.Customers join o in _NorthWindDataContext.Orders on c.CustomerID equals o.CustomerID group c by c.CustomerID into CutGroup where CutGroup.Sum(tab => tab.Orders.Sum(t => t.Order_Details.Sum(t1 => t1.Quantity * t1.Quantity))) < 10000 select new { CustomerID = CutGroup.Key, Total = CutGroup.Sum(tab => tab.Orders.Sum(t => t.Order_Details.Sum(t1 => t1.Quantity * t1.Quantity))), }; I have solved it but if I want to access Order table information then how can I access...
For your information I am binding customer to grid....so I can not use for each