我有多个OrderBy
但只有第一顺序列正在多个LINQ排序依据不工作
public static List<vwData> GetAllData(string startDate, string endDate)
{
DateTime dtStart = Convert.ToDateTime(startDate).Date;
DateTime dtEndDate = Convert.ToDateTime(endDate).Date;
var entities = new DataEntities();
var query = from c in entities.vwData
let eventDate = EntityFunctions.TruncateTime(c.EventCreateDate)
orderby c.EventCreateDate ascending, c.StartDateTime ascending
where eventDate >= dtStart && eventDate <= dtEndDate
select c;
return query.ToList();
}
你能提供样品输入数据和预期的输出吗? – Grundy
您的代码似乎确定,为什么您认为只有第一个订单正在工作? – Grundy