Currently I am searching through my list to find Customers that match on Address. I need to match on both address and city. How do I rewrite my lambda Expression to match both criteria?
CustomerList.FindAll(Function(c) c.Address = addressToMatch)
The keyword you are looking for is AndAlso. It combines two separate checks into a single one which evaluates to True iff both components are also True
CustomerList.FindAll(Function(c) c.Address = addressToMatch AndAlso c.City = cityToMatch)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With