I have an object with a string typed parameter called baan_cat_fam_code . The code below is my attempt to find all the elements in a query with baan_cat_fam_code that exist in a common list of strings called catFamCd .
query = query.Where(r => r.baan_cat_family_code.Any(s => catFamCode.Contains(s)));
The problem is that this will not compile - I get an error message that indicates
"Argument type 'char' is not assignable to parameter type 'string'"
for some reason, the predicate s is printed as char. Therefore, I am adding .ToString () to the argument of the .Contains method. However, when the code works, I get the following exception that occurred when the query result is bound to a list.
"The argument 'value' was the wrong type. Expected 'System.Char'. Actual 'System.String'."
It made me scratch my head. Any help would be greatly appreciated.
Thanks!
Andy evans
source share