📜  c# linq 排序顺序 guid - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:48.949000             🧑  作者: Mango

代码示例1
// https://stackoverflow.com/questions/48806510/descending-order-in-listguid-is-different-then-iqueryable-orderbydescending
// A cast to System.Data.SqlTypes.SqlGuid is needed to perform the same in-memory linq-sorting-result in comparison to SQL-Server sorting of UNIQUEIDENTIFIER
yourCollection.OrderBy(x => new SqlGuid(x.YourGuid))