MMD*_*MNC 2 entity-framework c#-4.0
我正在使用以下代码:
using(var sd=new dataEntities())
{
var listofdata=sd.users.where(d=>d.id.ToString().Contain("2"));// id as int
// error : LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.
}
Run Code Online (Sandbox Code Playgroud)
我看了看网站但没有找到答案
您需要使用SQL函数来转换ToString方法.
SqlFunctions.StringConvert((double)id)
Run Code Online (Sandbox Code Playgroud)