📅  最后修改于: 2022-03-11 14:49:02.039000             🧑  作者: Mango
using System.Linq;
//This list contains OrderDate, OrderID, Quantity, Total properties
List objListOrder = new List();
//How to GetOrderList(objListOrder)?
//Answer:
//- Ascending order
List SortedList = objListOrder.OrderBy(o=>o.OrderDate).ToList();
//- Descending order
List SortedList = objListOrder.OrderByDescending(o=>o.OrderDate).ToList();