data.Sort(Function(x, y) y.A.CompareTo(x.A)) Dim ret As Class1 = data(0)
Dim ret0 As Class1 = data.DefaultIfEmpty().Aggregate(Function(x, y) If(x.A < y.A, y, x)) Dim ret1 As Class1 = data.OrderByDescending(Function(c) c.A).FirstOrDefault() Dim ret2 As Class1 = (From c In data Order By c.A Descending).FirstOrDefault() Dim ret3 As Class1 = data.OrderBy(Function(c) c.A).LastOrDefault() Dim ret4 As Class1 = (From c In data Order By c.A).LastOrDefault() Dim ret6 As Class1 = data.Where(Function(x) x.A = data.Max(Function(y) y.A)).FirstOrDefault() Dim ret7 As Class1 = (From x In data Where x.A = Aggregate y In data Into Max(y.A)).FirstOrDefault()
'ToArray(あるいはToList)するかどうかはお好みで。 Dim list1() As Class1 = data.Where(Function(x) x.A = data.Max(Function(y) y.A)).ToArray() Dim list2() As Class1 = (From x In data Where x.A = Aggregate y In data Into Max(y.A)).ToArray()