我使用以下代码:LINQ到实体无法识别方法“System.String的ToString()”方法,和这种方法不能被翻译成表达商店
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.
}
我看着网站,但没有找到答案
可能重复http://stackoverflow.com/questions/1066760/problem-with-converting-int -to-字符串在-LINQ到实体) –