@@ -80,16 +80,52 @@ public MathGenerator()
80
80
ReflectHelper . FastGetMethod ( MathF . Ceiling , default ( float ) ) ,
81
81
82
82
ReflectHelper . FastGetMethod ( MathF . Pow , default ( float ) , default ( float ) ) ,
83
+ #endif
84
+ #if NET8_0_OR_GREATER
85
+ ReflectHelper . FastGetMethod ( float . Sin , default ( float ) ) ,
86
+ ReflectHelper . FastGetMethod ( float . Cos , default ( float ) ) ,
87
+ ReflectHelper . FastGetMethod ( float . Tan , default ( float ) ) ,
88
+ ReflectHelper . FastGetMethod ( float . Sinh , default ( float ) ) ,
89
+ ReflectHelper . FastGetMethod ( float . Cosh , default ( float ) ) ,
90
+ ReflectHelper . FastGetMethod ( float . Tanh , default ( float ) ) ,
91
+ ReflectHelper . FastGetMethod ( float . Asin , default ( float ) ) ,
92
+ ReflectHelper . FastGetMethod ( float . Acos , default ( float ) ) ,
93
+ ReflectHelper . FastGetMethod ( float . Atan , default ( float ) ) ,
94
+ ReflectHelper . FastGetMethod ( float . Atan2 , default ( float ) , default ( float ) ) ,
95
+ ReflectHelper . FastGetMethod ( float . Sqrt , default ( float ) ) ,
96
+ ReflectHelper . FastGetMethod ( float . Abs , default ( float ) ) ,
97
+ ReflectHelper . FastGetMethod ( float . Sign , default ( float ) ) ,
98
+ ReflectHelper . FastGetMethod ( float . Floor , default ( float ) ) ,
99
+ ReflectHelper . FastGetMethod ( float . Ceiling , default ( float ) ) ,
100
+ ReflectHelper . FastGetMethod ( float . Pow , default ( float ) , default ( float ) ) ,
101
+
102
+ ReflectHelper . FastGetMethod ( double . Sin , default ( double ) ) ,
103
+ ReflectHelper . FastGetMethod ( double . Cos , default ( double ) ) ,
104
+ ReflectHelper . FastGetMethod ( double . Tan , default ( double ) ) ,
105
+ ReflectHelper . FastGetMethod ( double . Sinh , default ( double ) ) ,
106
+ ReflectHelper . FastGetMethod ( double . Cosh , default ( double ) ) ,
107
+ ReflectHelper . FastGetMethod ( double . Tanh , default ( double ) ) ,
108
+ ReflectHelper . FastGetMethod ( double . Asin , default ( double ) ) ,
109
+ ReflectHelper . FastGetMethod ( double . Acos , default ( double ) ) ,
110
+ ReflectHelper . FastGetMethod ( double . Atan , default ( double ) ) ,
111
+ ReflectHelper . FastGetMethod ( double . Atan2 , default ( double ) , default ( double ) ) ,
112
+ ReflectHelper . FastGetMethod ( double . Sqrt , default ( double ) ) ,
113
+ ReflectHelper . FastGetMethod ( double . Abs , default ( double ) ) ,
114
+ ReflectHelper . FastGetMethod ( double . Sign , default ( double ) ) ,
115
+ ReflectHelper . FastGetMethod ( double . Floor , default ( double ) ) ,
116
+ ReflectHelper . FastGetMethod ( double . Ceiling , default ( double ) ) ,
117
+ ReflectHelper . FastGetMethod ( double . Pow , default ( double ) , default ( double ) ) ,
83
118
#endif
84
119
} ;
85
120
}
86
121
87
122
public override HqlTreeNode BuildHql ( MethodInfo method , Expression expression , ReadOnlyCollection < Expression > arguments , HqlTreeBuilder treeBuilder , IHqlExpressionVisitor visitor )
88
123
{
89
- string function = method . Name . ToLowerInvariant ( ) ;
90
-
91
- if ( function == "pow" )
92
- function = "power" ;
124
+ var function = method . Name . ToLowerInvariant ( ) switch
125
+ {
126
+ "pow" => "power" ,
127
+ var f => f ,
128
+ } ;
93
129
94
130
var firstArgument = visitor . Visit ( arguments [ 0 ] ) . AsExpression ( ) ;
95
131
0 commit comments