Find Object in List
Method 1
Mothod 2
Method 1
Function PredicatFunction( ByVal tempProduct As Product) as boolean
Return tempProduct.ProductID='MyID'
End Function
Dim MyList As List(Of Product)=new List(Of Product)
Dim tmpProduct as Product=MyList.Find(AddressOf PredicatFunction )
Mothod 2
Dim ProductID as String='MyID'
Dim MyList As List(Of product)=new List(Of product)
Dim tmpProduct as Product=MyList.Find(Function(n) n.ProductID=productID )
留言