Order by a field (int). If the field it is not int?

前端 未结 3 1798
执念已碎
执念已碎 2021-01-25 19:44

I have a problem with LINQ (in C#). I need to order a list of records by a field, which should be int, but sometimes not :

from MyObject obj in new          


        
3条回答
  •  既然无缘
    2021-01-25 20:09

    If it is possible try adding a column in database IsInteger which stores if the order is integer or not at time of Insert.

    So, it will be easy to get and sort integer and non-integer orders.

提交回复
热议问题