I am trying to implement a method where the keywords stored in the database for an activity (split by a comma) match the giving string split by a comma.
public List<TblActivities> SearchByMultipleKeyword(string keywords)
{
string[] keyword = keywords.Split(',');
var results = (from a in Entities.TblActivities
where a.Keywords.Split(',').Any(p => keyword.Contains(p))
select a).ToList();
return results;
}
I am getting the following error :
LINQ to Entities does not recognize the method 'System.String[] Split(Char[])' method,
and this method cannot be translated into a store expression.