linq如何根据计算值进行排序 如题: 查询代码如下: var result = from a in db.CustomerProjectTable join b in db.AccountTable on a.AccountID equals b.AccountID join c in db.AccountTable on a.CheckerID equals c.AccountID join d in db.StatusTable on a.Status equals d.ChildID where new int[]{(int)CustomerProjectStatus.Building,(int)CustomerProjectStatus.BuildCompleted,(int)CustomerProjectStatus.ConsCompleted}.Contains(a.Status) select new { a.CPID, a.ProjectCode, AccountName = b.ScreenName, CheckerName = c.ScreenName, IsRemind=this.IsRemind(a.CPID), RemindDay=this.GetLeftRemindDays(a.CPID), CreateTime = String.Format(@"{0:yy-MM-dd}",a.CreateTime), CheckTime = !a.CheckTime.HasValue ? "-" : String.Format(@"{0:yy-MM-dd}", a.CheckTime), a.ProjectName, StatusName = d.EN_Name, PlanTime=String.Format(@"{0:yy-MM-dd}",GetEndDate(a.CPID)), RunTime=String.Format(@"{0:yy-MM-dd}",a.RunTime), RealTime = String.Format(@"{0:yy-MM-dd}", a.RealTime), URL = UrlMgr.GetUrlForCustomerProjectEdit(a.CPID), WakeAudit = this.GetWakeAudit(a.CPID) };
where CustomerProjectStatus.Building==a.Status ||
CustomerProjectStatus==a.Status || BuildCompleted==a.Status ||
CustomerProjectStatus.ConsCompleted==a.Status
let r=this.GetLeftRemindDays(a.CPID)
order by r
select .......
------解决方案--------------------