2011-12-23 67 views
0

我如何得到這個正常工作不工作?我想order by duedate desc, type訂單通過EF我所希望的

我目前有:

billSummaryRepository.GetBillSummaries(logIn.CustomerNumber) 
    .OrderByDescending(o => o.DueDate) 
    .OrderBy(o => o.Type) 

這工作:

BillSummaries = billSummaryRepository.GetBillSummaries(logIn.CustomerNumber) 
    .OrderBy(o => o.Type) 
    .OrderByDescending(o => o.DueDate) 

而且是多麼危險?它會起作用嗎?

回答

2
BillSummaries = billSummaryRepository 
    .GetBillSummaries(logIn.CustomerNumber) 
    .OrderByDescending(o => o.DueDate) 
    .ThenBy(o => o.Type);