Hi,
I've been tearing my hair out with this one. I've got an array of search terms and I'm trying to do a LINQ to SQL query to search field values against each item in the array.
I got this far..
var searchResults =
from x in SDC.Staff_Persons
where staffTermArray.Any(pinq => x.Forename.Contains(pinq))
|| staffTermArray.Any(pinq => x.Surname.Contains(pinq))
|| staffTermArray.Any(pinq => x.Known_as.Contains(pinq))
orderby x.Surname
select x;
... but then got
Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains() operator
... and now I'm stuck.
If anyone can help I'd be very grateful. Thanks in advance.
Rob