-1
フレキシブルな配列に応じて動的なフィールド数でソートを行う必要があります。私は現在、配列の最大インデックスを使用して問題を解決しましたが、配列の実際のサイズに応じてこれを解決するほうがよかったでしょう。LINQ:動的なフィールド数による複数の並べ替え
は今のところ、それは次のようになります。
outList.Items = outList.Items.OrderByDescending(x => x.PointsOverall)
.ThenByDescending(x => x.Results[7].PointValue)
.ThenByDescending(x => x.Results[6].PointValue)
.ThenByDescending(x => x.Results[5].PointValue)
.ThenByDescending(x => x.Results[4].PointValue)
.ThenByDescending(x => x.Results[3].PointValue)
.ThenByDescending(x => x.Results[2].PointValue)
.ThenByDescending(x => x.Results[1].PointValue)
.ThenByDescending(x => x.Results[0].PointValue)
.ThenBy(x => x.Results.Last().FullName).ToList();
ソート以内に0まで行くの最後の要素から始まる減算カウンタのようなものを含める方法はありますか?
ありがとうございます。