I\'m using Linq-to-SQL and I use compiled Linq for better performance.
I have users table with a INT
field called \"LookingFor\" that can have the follo
I'm facing the same problem. I have managed for now just one workaround for this problem. Instead of using
u.LookingFor.ToString().Contains(lookingFor)
I've used
u.LookingFor.ToString().IndexOf(lookingFor) >= 0
You're performing operations on the lookingFor argument that cannot be translated to SQL. I'm actually surprised that this works when not compiling the query.
If it's possible, I suggest that you change your database to make this query easier. Create a table to store the LookingFor property for users. Or you can change the datatype of lookingFor to a string, which has less of an impact on the database design.