【发布时间】:2012-04-21 16:47:14
【问题描述】:
当我尝试运行以下代码时。
var result = from c in db.brand
where c.title.contains("test")
select c.title + "-" +c.brand;
List<string> lst = r.ToList();
它给出以下错误。
LINQ to Entities 无法识别方法 'System.String ToString()' 方法,并且这个方法不能翻译成store 表达。
【问题讨论】:
-
这解释了为什么会发生这种情况 - stackoverflow.com/questions/1228318/linq-int-to-string