LINQ根据时间排序问题(OrderBy、OrderByDescending)

直接上代码:

db.GetList<Draw2D>(x => x.ProductId == id && x.EditionNo == no)
    .OrderBy(x => x.CreateTime.Desc())
    .ToList();

这个无法排序!!!

return db.GetList<Draw2D>(x => x.ProductId == id && x.EditionNo == no)
        .OrderByDescending(x => x.CreateTime)
        .ToList();

这个可以!

猜你喜欢

转载自www.cnblogs.com/stickcsharp/p/12509136.html