Custom OrderBy on a List

前端 未结 5 1164
旧巷少年郎
旧巷少年郎 2021-02-18 18:51

I\'m trying to figure out the best way to custom sort a List. Lets say that T is a Object with a date(DateTime?) property and a status(string) property.

I have 3 cases.

5条回答
  •  借酒劲吻你
    2021-02-18 19:22

    Shouldn't be too difficult, just make T implement IComparable using your comparison rules and you should be set.

提交回复
热议问题