Public Class GroupSelect
Public Property RowNo() As Integer
Get
Return m_RowNo
End Get
Set(ByVal value As Integer)
m_RowNo = value
End Set
End Property
Private m_RowNo As Integer
Public Property GroupNo() As Integer
Get
Return m_GroupNo
End Get
Set(ByVal value As Integer)
m_GroupNo = value
End Set
End Property
Private m_GroupNo As Integer
End Class
//Here I need to write LINQ statement and replace below code
For Each item As GroupSelect In grpSelectionList
If item.RowNo = rowNo And item.GroupNo = grpNo Then
grpSelectionList.Remove(item)
End If
Next
How would LINQ help here, particularly in VB.NET?
Anyway, you don’t appear to have a multidimensional list at all but rather a class collection.
This should work if you want a new list without those items:
In the query-like syntax that is:
What you currently have shouldn’t work anyway as you are modifying the collection you are iterating over. Anyway you could do this: