You cannot do this using the Entity Framework, as the error message says.
However, there are options.
One option is to understand that if keywords are stored as A,B,C,D , then x is there if
a.Keywords.StartsWith(x + ",") || a.Keywords.Contains("," + x + ",") || a.Keywords.EndsWith("," + x)
This works if x does not contain,. The disadvantage is that it will do a full scan of the table or index containing the Keywords column.
Another option is to normalize your database. In the end, you have a relationship between one action and a keyword. Then simulate it as such: in addition to the Activities table (without the Keywords column), enter a Keywords table with two columns, a foreign key in the action table, and a keyword column. This will allow you to add an index to the keyword column, which can make the query very fast.
UPDATE
I re-read your question and noticed that you are not testing keyword equality, but just Contains . If so, why don't you just do the following?
a.Keywords.Contains(x)
source share