My project was working just fine until I had to account for an array of strings and not just one... I don't know how to fix this. The Country
is a property of the current class this method is in. It used to be a single string but now is an array.
Originally it looked like this:
private Expression<Func<Payment, bool>> CountryMatches()
{
if (Country.Length < 1) return Skip;
return payment => payment.Country.ToLower().Contains(Country.ToLower());
}
What I can't figure out is how to set it up so that if ANY of the strings in Country
match payment.Country
... and of course this is passing back an expression... This is my best guess (but obviously not correct) of how to do what I need to do:
private Expression<Func<Payment, bool>> CountryMatches()
{
if (Country.Length < 1) return Skip;
return payment => payment.Country.ToLower() == Country.Any().ToLower();
}