Sorting a list of <Object> with VB and LINQ

后端 未结 2 842
既然无缘
既然无缘 2021-02-20 16:23

I\'m trying out some LINQ expressions and can\'t get them to work with the List class. Basically I want to be able to sort a list of custom objects by property type, however t

2条回答
  •  野性不改
    2021-02-20 17:23

    I used c# to VB converter..

    Dim sortedasc = l.OrderBy(Function(k) k.Position) 
    Dim sorteddesc = l.OrderByDescending(Function(k) k.Position)
    

    this should work..

提交回复
热议问题