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.
publ
For queries that do not involve too many keywords and too many rows you could implement this simple and quick solution. You can easily get around the Split function by repeatedly refining your results as follows:
public List SearchByMultipleKeyword(string keywords)
{
string[] keywords = pKeywords.Split(',');
var results = Entities.TblActivities.AsQueryable();
foreach(string k in keywords){
results = from a in results
where a.Keywords.Contains(k)
select a;
}
return results.ToList();
}