Query : SqlServerMathRoundTranslator wrong argument index results in returning incorrect data or throwing InvalidCastException #7600
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
Trying to use
Math.Round
in the query givesInvalidCastException
Steps to reproduce
Follow Entity Framework Core docs, build the model, populate Blogs table with few entities and then used this to query:
The console logging shows what went wrong:
The line
should be
and is there because of a bug in
SqlServerMathRoundTranslator.cs
#L34. There should beI did that as I wanted to check whether mathemathical functions are run on the server side. And actually
Math.Round
wasn't the one I was looking for, but checked them all. I guess I should create another Issue with this, but could you implement trigonometric functions +Math.Sqrt
,Math.Log
,Math.Log10
,Math.Exp
as well?Further technical details
EF Core version: 1.1.0 (but present in all, as I see)
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10 Pro
IDE: Visual Studio 2015
The text was updated successfully, but these errors were encountered: