How to convert from decimal to double in Linq to Entity
问题 Suppose we have table T which has two columns A and B with float and money types respectively. I want to write a linq query like following T-SQL statement: Select A, B, A * B as C From SomeTable Where C < 1000 I tried to cast like following var list = (from row in model.Table where ((decimal)row.A) * row.B < 1000 select new { A = row.A, B = row.B , C = ((decimal)row.A) * row.B} ).ToList(); but it does not allow the cast operation. It throw an exception: Casting to Decimal is not supported in