。LINQ to Entities無法識別方法'System.String ToString()'方法,並且在嘗試運行以下代碼時,此方法無法轉換爲存儲表達式
var result = from c in db.brand
where c.title.contains("test")
select c.title + "-" +c.brand;
List<string> lst = r.ToList();
它給出了以下錯誤。
LINQ實體無法識別方法「System.String 的ToString()」方法,和這種方法不能被翻譯成存儲 表達。
這解釋了爲什麼會發生這種情況 - http://stackoverflow.com/questions/1228318/ linq-int-to-string – StuartLC 2012-04-09 09:15:59