Your problem is that LINQ-to-Entites has to translate everything you give it into SQL to send to the database.
If that is really what you need to do, you'll have to force LINQ-to-Entities to pull back all the data and LINQ-to-Objects to evaluate the condition.
Ex:
var aKeyword = "ACT";
var results = from a in db.Activities.ToList()
where a.Keywords.Split(',').Contains(aKeyword) == true
select a;
Be aware though, that this will pull back all the objects from the Activities table. An alternative may be to let the DB do a bit of an initial filter, and filter down the rest of the way afterwards:
var aKeyword = "ACT";
var results = (from a in db.Activities
where a.Keywords.Contains(aKeyword)
select a).ToList().Where(a => a.KeyWords.Split(',').Contains(aKeyword));
That will let LINQ-to-Entities do the filter it understands (string.Contains becomes a like query) that will filter down some of the data, then apply the real filter you want via LINQ-to-Objects once you have the objects back. The ToList() call forces LINQ-to-Entities to run the query and build the objects, allowing LINQ-to-Objects to be the engine that does the second part of the query.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…