Skip to content

Instantly share code, notes, and snippets.

@dieseltravis
Created April 22, 2009 21:40
Show Gist options
  • Select an option

  • Save dieseltravis/100103 to your computer and use it in GitHub Desktop.

Select an option

Save dieseltravis/100103 to your computer and use it in GitHub Desktop.
filtering a list by an object's property in VB.Net 2.0
Private _searchString As String
Private Function FindSomeObjectById(ByVal o As SomeObject) As Boolean
Dim searchID as Integer = 0
Integer.TryParse(_searchString, searchID)
Return o.Id = searchID
End Function
'etc...
' get SomeObject matching its ID
_searchString = "123"
Dim o As SomeObject = SomeObjectGenericList.Find(AddressOf FindSomeObjectById)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment