I have a class called Order
which has properties such as OrderId
, OrderDate
, Quantity
, and Total
.
(我有一个名为Order
的类,它具有诸如OrderId
, OrderDate
, Quantity
和Total
属性。)
I have a list of this Order
class: (我有此Order
类的列表:)
List<Order> objListOrder = new List<Order>();
GetOrderList(objListOrder); // fill list of orders
Now I want to sort the list based on one property of the Order
object, for example I need to sort it by the order date or order id.
(现在,我想基于Order
对象的一个??属性对列表进行排序,例如,我需要按订单日期或订单ID对其进行排序。)
How can i do this in C#?
(我该如何在C#中做到这一点?)
ask by Shyju translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…