LINQ orderby on date field in descending order

前端 未结 4 509
广开言路
广开言路 2020-12-24 06:18

How can I change the LINQ query in the code below to sort by date in descending order (latest first, earliest last)?

using System;
using System.Linq;
using S         


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-24 06:44

    This statement will definitely help you:

    env = env.OrderByDescending(c => c.ReportDate).ToList();
    

提交回复
热议问题