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()
Dim list3 As New List(Of Class1)() For Each x In data If x.A = GetMax(data) Then '最大値の取得 list3.Add( x ) End If Next
Dim list4 As New List(Of Class1)() Dim maxValue As Integer = GetMax(data) '最大値の取得 For Each x In data If x.A = maxValue Then list3.Add( x ) End If Next
Dim maxValue As Integer = (From x In data Select x.A).Max() Dim list5() As Class1 = data.Where(Function(x) x.A = maxValue).ToArray() Dim list6() As Class1 = (From x In data Where x.A = maxValue).ToArray()