我想找出哪个员工的订单最多:这段代码带来了所有用户的所有订单数:
public void GetBestEmployeeFromDates(DateTime fromDate, DateTime toDate)
{
using (NorthwindDataContext db = new NorthwindDataContext())
{
var query =
from z in db.Employees
select new
{
OrderNumber = z.Orders.Where(x => x.OrderDate > fromDate.Date).Count()
};
}
}
我该怎么做?