How to Sort a List by a property in the object

前端 未结 20 1985
醉梦人生
醉梦人生 2020-11-21 08:25

I have a class called Order which has properties such as OrderId, OrderDate, Quantity, and Total. I have a l

20条回答
  •  北荒
    北荒 (楼主)
    2020-11-21 08:33

    var obj = db.Items.Where...
    
    var orderBYItemId = obj.OrderByDescending(c => Convert.ToInt32(c.ID));
    

提交回复
热议问题