Created
April 22, 2009 21:40
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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