I have a LINQ statement that i want to do a sum of some a single column that is of type String.
I am trying to do the following statement where i am Converting.ToInt32. When i run this i am getting the following error.
LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression.
LINQ statement
var CoreData = new
{
Shoots =
(from item in coresdb.Productions
where item.Date >= StartShift && item.Date <= EndDate
select item).Sum(x => Convert.ToInt32(x.ShootCount)
)
};
I have tried a number of different data types to convert too and get a similar error.