我有一个LINQ语句,我想对字符串类型的单个列进行求和。LINQ to Entities无法识别方法'Int32 ToInt32将字符串转换为Int
我想要做以下的语句,我是Converting.ToInt32。当我运行这个我得到以下错误。
LINQ实体无法识别方法“的Int32 ToInt32(System.String)”方法,和这种方法不能被翻译成 商店表达。
LINQ声明
var CoreData = new
{
Shoots =
(from item in coresdb.Productions
where item.Date >= StartShift && item.Date <= EndDate
select item).Sum(x => Convert.ToInt32(x.ShootCount)
)
};
我已经尝试了许多不同类型的数据过于转换,并得到了类似的错误。
Duplicate:http://stackoverflow.com/questions/13887296/linq-to-entities-does-not-recognize-the-method-int32-int32system-string-meth – melancia