私は私のgクラスのリストを持っています
Public Class g
Public x as Decimal
Public y As Decimal
End Class
Dim MyQuery As List(Of g) = ...
私は次のように並べ替えようとしています
Dim sorted As List(Of g) = MyQuery.OrderBy(Function(x) x.y).ThenBy(Function(x) x.x).ToList()
残念ながら、次のエラーが表示されます
少なくとも 1 つのオブジェクトが IComparable を実装する必要があります。
ここで何が間違っていますか?1 つのプロパティで並べ替えようとすると、エラーは発生しません
Dim sorted As List(Of g) = MyQuery.OrderBy(Function(x) x.y).ToList()