@@ -13,62 +13,62 @@ public class CosmosMathTranslator : IMethodCallTranslator
1313{
1414 private static readonly Dictionary < MethodInfo , string > SupportedMethodTranslations = new ( )
1515 {
16- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , new [ ] { typeof ( decimal ) } ) ! , "ABS" } ,
17- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , new [ ] { typeof ( double ) } ) ! , "ABS" } ,
18- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , new [ ] { typeof ( float ) } ) ! , "ABS" } ,
19- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , new [ ] { typeof ( int ) } ) ! , "ABS" } ,
20- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , new [ ] { typeof ( long ) } ) ! , "ABS" } ,
21- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , new [ ] { typeof ( sbyte ) } ) ! , "ABS" } ,
22- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , new [ ] { typeof ( short ) } ) ! , "ABS" } ,
23- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Ceiling ) , new [ ] { typeof ( decimal ) } ) ! , "CEILING" } ,
24- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Ceiling ) , new [ ] { typeof ( double ) } ) ! , "CEILING" } ,
25- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Floor ) , new [ ] { typeof ( decimal ) } ) ! , "FLOOR" } ,
26- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Floor ) , new [ ] { typeof ( double ) } ) ! , "FLOOR" } ,
27- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Pow ) , new [ ] { typeof ( double ) , typeof ( double ) } ) ! , "POWER" } ,
28- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Exp ) , new [ ] { typeof ( double ) } ) ! , "EXP" } ,
29- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Log10 ) , new [ ] { typeof ( double ) } ) ! , "LOG10" } ,
30- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Log ) , new [ ] { typeof ( double ) } ) ! , "LOG" } ,
31- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Log ) , new [ ] { typeof ( double ) , typeof ( double ) } ) ! , "LOG" } ,
32- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sqrt ) , new [ ] { typeof ( double ) } ) ! , "SQRT" } ,
33- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Acos ) , new [ ] { typeof ( double ) } ) ! , "ACOS" } ,
34- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Asin ) , new [ ] { typeof ( double ) } ) ! , "ASIN" } ,
35- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Atan ) , new [ ] { typeof ( double ) } ) ! , "ATAN" } ,
36- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Atan2 ) , new [ ] { typeof ( double ) , typeof ( double ) } ) ! , "ATN2" } ,
37- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Cos ) , new [ ] { typeof ( double ) } ) ! , "COS" } ,
38- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sin ) , new [ ] { typeof ( double ) } ) ! , "SIN" } ,
39- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Tan ) , new [ ] { typeof ( double ) } ) ! , "TAN" } ,
40- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , new [ ] { typeof ( decimal ) } ) ! , "SIGN" } ,
41- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , new [ ] { typeof ( double ) } ) ! , "SIGN" } ,
42- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , new [ ] { typeof ( float ) } ) ! , "SIGN" } ,
43- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , new [ ] { typeof ( int ) } ) ! , "SIGN" } ,
44- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , new [ ] { typeof ( long ) } ) ! , "SIGN" } ,
45- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , new [ ] { typeof ( sbyte ) } ) ! , "SIGN" } ,
46- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , new [ ] { typeof ( short ) } ) ! , "SIGN" } ,
47- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Truncate ) , new [ ] { typeof ( decimal ) } ) ! , "TRUNC" } ,
48- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Truncate ) , new [ ] { typeof ( double ) } ) ! , "TRUNC" } ,
49- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Round ) , new [ ] { typeof ( decimal ) } ) ! , "ROUND" } ,
50- { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Round ) , new [ ] { typeof ( double ) } ) ! , "ROUND" } ,
51- { typeof ( double ) . GetRuntimeMethod ( nameof ( double . DegreesToRadians ) , new [ ] { typeof ( double ) } ) ! , "RADIANS" } ,
52- { typeof ( double ) . GetRuntimeMethod ( nameof ( double . RadiansToDegrees ) , new [ ] { typeof ( double ) } ) ! , "DEGREES" } ,
53- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Ceiling ) , new [ ] { typeof ( float ) } ) ! , "CEILING" } ,
54- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Floor ) , new [ ] { typeof ( float ) } ) ! , "FLOOR" } ,
55- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Pow ) , new [ ] { typeof ( float ) , typeof ( float ) } ) ! , "POWER" } ,
56- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Exp ) , new [ ] { typeof ( float ) } ) ! , "EXP" } ,
57- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Log10 ) , new [ ] { typeof ( float ) } ) ! , "LOG10" } ,
58- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Log ) , new [ ] { typeof ( float ) } ) ! , "LOG" } ,
59- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Log ) , new [ ] { typeof ( float ) , typeof ( float ) } ) ! , "LOG" } ,
60- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Sqrt ) , new [ ] { typeof ( float ) } ) ! , "SQRT" } ,
61- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Acos ) , new [ ] { typeof ( float ) } ) ! , "ACOS" } ,
62- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Asin ) , new [ ] { typeof ( float ) } ) ! , "ASIN" } ,
63- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Atan ) , new [ ] { typeof ( float ) } ) ! , "ATAN" } ,
64- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Atan2 ) , new [ ] { typeof ( float ) , typeof ( float ) } ) ! , "ATN2" } ,
65- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Cos ) , new [ ] { typeof ( float ) } ) ! , "COS" } ,
66- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Sin ) , new [ ] { typeof ( float ) } ) ! , "SIN" } ,
67- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Tan ) , new [ ] { typeof ( float ) } ) ! , "TAN" } ,
68- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Truncate ) , new [ ] { typeof ( float ) } ) ! , "TRUNC" } ,
69- { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Round ) , new [ ] { typeof ( float ) } ) ! , "ROUND" } ,
70- { typeof ( float ) . GetRuntimeMethod ( nameof ( float . DegreesToRadians ) , new [ ] { typeof ( float ) } ) ! , "RADIANS" } ,
71- { typeof ( float ) . GetRuntimeMethod ( nameof ( float . RadiansToDegrees ) , new [ ] { typeof ( float ) } ) ! , "DEGREES" } ,
16+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , [ typeof ( decimal ) ] ) ! , "ABS" } ,
17+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , [ typeof ( double ) ] ) ! , "ABS" } ,
18+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , [ typeof ( float ) ] ) ! , "ABS" } ,
19+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , [ typeof ( int ) ] ) ! , "ABS" } ,
20+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , [ typeof ( long ) ] ) ! , "ABS" } ,
21+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , [ typeof ( sbyte ) ] ) ! , "ABS" } ,
22+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Abs ) , [ typeof ( short ) ] ) ! , "ABS" } ,
23+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Ceiling ) , [ typeof ( decimal ) ] ) ! , "CEILING" } ,
24+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Ceiling ) , [ typeof ( double ) ] ) ! , "CEILING" } ,
25+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Floor ) , [ typeof ( decimal ) ] ) ! , "FLOOR" } ,
26+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Floor ) , [ typeof ( double ) ] ) ! , "FLOOR" } ,
27+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Pow ) , [ typeof ( double ) , typeof ( double ) ] ) ! , "POWER" } ,
28+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Exp ) , [ typeof ( double ) ] ) ! , "EXP" } ,
29+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Log10 ) , [ typeof ( double ) ] ) ! , "LOG10" } ,
30+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Log ) , [ typeof ( double ) ] ) ! , "LOG" } ,
31+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Log ) , [ typeof ( double ) , typeof ( double ) ] ) ! , "LOG" } ,
32+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sqrt ) , [ typeof ( double ) ] ) ! , "SQRT" } ,
33+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Acos ) , [ typeof ( double ) ] ) ! , "ACOS" } ,
34+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Asin ) , [ typeof ( double ) ] ) ! , "ASIN" } ,
35+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Atan ) , [ typeof ( double ) ] ) ! , "ATAN" } ,
36+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Atan2 ) , [ typeof ( double ) , typeof ( double ) ] ) ! , "ATN2" } ,
37+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Cos ) , [ typeof ( double ) ] ) ! , "COS" } ,
38+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sin ) , [ typeof ( double ) ] ) ! , "SIN" } ,
39+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Tan ) , [ typeof ( double ) ] ) ! , "TAN" } ,
40+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , [ typeof ( decimal ) ] ) ! , "SIGN" } ,
41+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , [ typeof ( double ) ] ) ! , "SIGN" } ,
42+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , [ typeof ( float ) ] ) ! , "SIGN" } ,
43+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , [ typeof ( int ) ] ) ! , "SIGN" } ,
44+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , [ typeof ( long ) ] ) ! , "SIGN" } ,
45+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , [ typeof ( sbyte ) ] ) ! , "SIGN" } ,
46+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Sign ) , [ typeof ( short ) ] ) ! , "SIGN" } ,
47+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Truncate ) , [ typeof ( decimal ) ] ) ! , "TRUNC" } ,
48+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Truncate ) , [ typeof ( double ) ] ) ! , "TRUNC" } ,
49+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Round ) , [ typeof ( decimal ) ] ) ! , "ROUND" } ,
50+ { typeof ( Math ) . GetRuntimeMethod ( nameof ( Math . Round ) , [ typeof ( double ) ] ) ! , "ROUND" } ,
51+ { typeof ( double ) . GetRuntimeMethod ( nameof ( double . DegreesToRadians ) , [ typeof ( double ) ] ) ! , "RADIANS" } ,
52+ { typeof ( double ) . GetRuntimeMethod ( nameof ( double . RadiansToDegrees ) , [ typeof ( double ) ] ) ! , "DEGREES" } ,
53+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Ceiling ) , [ typeof ( float ) ] ) ! , "CEILING" } ,
54+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Floor ) , [ typeof ( float ) ] ) ! , "FLOOR" } ,
55+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Pow ) , [ typeof ( float ) , typeof ( float ) ] ) ! , "POWER" } ,
56+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Exp ) , [ typeof ( float ) ] ) ! , "EXP" } ,
57+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Log10 ) , [ typeof ( float ) ] ) ! , "LOG10" } ,
58+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Log ) , [ typeof ( float ) ] ) ! , "LOG" } ,
59+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Log ) , [ typeof ( float ) , typeof ( float ) ] ) ! , "LOG" } ,
60+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Sqrt ) , [ typeof ( float ) ] ) ! , "SQRT" } ,
61+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Acos ) , [ typeof ( float ) ] ) ! , "ACOS" } ,
62+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Asin ) , [ typeof ( float ) ] ) ! , "ASIN" } ,
63+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Atan ) , [ typeof ( float ) ] ) ! , "ATAN" } ,
64+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Atan2 ) , [ typeof ( float ) , typeof ( float ) ] ) ! , "ATN2" } ,
65+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Cos ) , [ typeof ( float ) ] ) ! , "COS" } ,
66+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Sin ) , [ typeof ( float ) ] ) ! , "SIN" } ,
67+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Tan ) , [ typeof ( float ) ] ) ! , "TAN" } ,
68+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Truncate ) , [ typeof ( float ) ] ) ! , "TRUNC" } ,
69+ { typeof ( MathF ) . GetRuntimeMethod ( nameof ( MathF . Round ) , [ typeof ( float ) ] ) ! , "ROUND" } ,
70+ { typeof ( float ) . GetRuntimeMethod ( nameof ( float . DegreesToRadians ) , [ typeof ( float ) ] ) ! , "RADIANS" } ,
71+ { typeof ( float ) . GetRuntimeMethod ( nameof ( float . RadiansToDegrees ) , [ typeof ( float ) ] ) ! , "DEGREES" } ,
7272 } ;
7373
7474 private readonly ISqlExpressionFactory _sqlExpressionFactory ;
0 commit comments