Compiled Linq & String.Contains

后端 未结 2 824
暗喜
暗喜 2021-01-20 19:05

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

2条回答
  •  孤城傲影
    2021-01-20 19:38

    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.

提交回复
热议问题