From 1550b884b0c39502fc8705e465fe3c252064b276 Mon Sep 17 00:00:00 2001 From: Laurents Meyer Date: Fri, 22 Sep 2023 15:48:36 +0200 Subject: [PATCH] Add DegreesToRadians() and RadiansToDegrees() support for float/double. --- src/EFCore.MySql/Query/Internal/MySqlMathMethodTranslator.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/EFCore.MySql/Query/Internal/MySqlMathMethodTranslator.cs b/src/EFCore.MySql/Query/Internal/MySqlMathMethodTranslator.cs index 8c2c59287..a5b7020fe 100644 --- a/src/EFCore.MySql/Query/Internal/MySqlMathMethodTranslator.cs +++ b/src/EFCore.MySql/Query/Internal/MySqlMathMethodTranslator.cs @@ -42,6 +42,11 @@ public class MySqlMathMethodTranslator : IMethodCallTranslator { typeof(Math).GetRuntimeMethod(nameof(Math.Cos), new[] { typeof(double) }), ("COS", true) }, { typeof(MathF).GetRuntimeMethod(nameof(MathF.Cos), new[] { typeof(float) }), ("COS", true) }, + { typeof(double).GetRuntimeMethod(nameof(double.DegreesToRadians), new[] { typeof(double) })!, ("RADIANS", true) }, + { typeof(float).GetRuntimeMethod(nameof(float.DegreesToRadians), new[] { typeof(float) })!, ("RADIANS", true) }, + { typeof(double).GetRuntimeMethod(nameof(double.RadiansToDegrees), new[] { typeof(double) })!, ("DEGREES", true) }, + { typeof(float).GetRuntimeMethod(nameof(float.RadiansToDegrees), new[] { typeof(float) })!, ("DEGREES", true) }, + { typeof(Math).GetRuntimeMethod(nameof(Math.Exp), new[] { typeof(double) }), ("EXP", true) }, { typeof(MathF).GetRuntimeMethod(nameof(MathF.Exp), new[] { typeof(float) }), ("EXP", true) },