我使用以下代碼: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到實體) –