如何使用LINQ对多个字段进行排序?

Ala*_*an2 5 c# linq

有人可以通过向我展示如何对LINQ表达式进行排序来提供帮助.

我有以下内容:

 .OrderByDescending(item => item.RowKey)
 .Select((t, index) => new City.Grid()
           {
               PartitionKey = t.PartitionKey,
               RowKey = t.RowKey,
               Row = index + 1,
               ShortTitle = t.ShortTitle,

           })
Run Code Online (Sandbox Code Playgroud)

我想做的是对以下内容进行排序:

1)前四个字符或字段RowKey
2)ShortTitle

我不知道如何对几个字符进行排序,也不确定如何进行二次排序.

Jon*_*ton 8

对于前四个字符,请在现有语句中包含该字符,然后再添加ShortTitle

.OrderByDescending(item => item.RowKey.Substring(0,4))
.ThenBy(item => item.ShortTitle)
Run Code Online (Sandbox Code Playgroud)