0
나는 다른 영역재주문 LINQ 목록
Public Class CollectionZone
Inherits System.Collections.Generic.List(Of ClassZone)
' ....
End Class
두 번째 클래스가 포함 된 클래스가 있습니다
Public Class ClassZone
Public Property debutXMetres As Double
End Class
내가 그와 순서를 변경하고 싶습니다를 재산, 내가 tryed
dim collection as new CollectionZone
'init collection
collection = cType(collection.OrderBy(Function(obj) obj.debutXMetres).ToList(), CollectionZone)
그러나 나는 잘못된 캐스트가 있습니다. CollectionZone 클래스를 복구하려면 어떻게해야합니까?
감사
는 예외를하지 않았다, 당신의 코드를 시도했다. – Magnus
이상합니다. 컬렉션에 개체를 넣었 니? 잘못된 캐스트 예외가 있습니다. –
예, 문제가 없습니다. – Magnus