I was trying to sum up a column of type nvarchar(7)
that I need to first convert data to decimal(18, 7)
.
I used this LINQ query:
var Data = queryBase.Select(q => new { totalVol = q.Collection.Sum(c => Convert.ToDecimal(c.Volume) }).FirstOrDefault();
However I got an exception
LINQ to Entities does not recognize the method 'System.Decimal ToDecimal(System.String)' method...
Any help will be greatly appreciated.