@@ -53,9 +53,9 @@ public class NpgsqlGeometryMethodTranslator : IMethodCallTranslator
5353 private readonly IRelationalTypeMappingSource _typeMappingSource ;
5454
5555 private static readonly bool [ ] [ ] TrueArrays =
56- {
57- Array . Empty < bool > ( ) , new [ ] { true } , new [ ] { true , true } , new [ ] { true , true , true } , new [ ] { true , true , true , true }
58- } ;
56+ [
57+ [ ] , [ true ] , [ true , true ] , [ true , true , true ] , [ true , true , true , true ]
58+ ] ;
5959
6060 /// <summary>
6161 /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
@@ -157,65 +157,65 @@ public NpgsqlGeometryMethodTranslator(
157157 return method . Name switch
158158 {
159159 nameof ( Geometry . AsBinary )
160- => Function ( "ST_AsBinary" , new [ ] { instance } , typeof ( byte [ ] ) ) ,
160+ => Function ( "ST_AsBinary" , [ instance ] , typeof ( byte [ ] ) ) ,
161161 nameof ( Geometry . AsText )
162- => Function ( "ST_AsText" , new [ ] { instance } , typeof ( string ) ) ,
162+ => Function ( "ST_AsText" , [ instance ] , typeof ( string ) ) ,
163163 nameof ( Geometry . Buffer )
164164 => Function ( "ST_Buffer" , new [ ] { instance } . Concat ( arguments ) . ToArray ( ) , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
165165 nameof ( Geometry . Contains )
166- => Function ( "ST_Contains" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
166+ => Function ( "ST_Contains" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
167167 nameof ( Geometry . ConvexHull )
168- => Function ( "ST_ConvexHull" , new [ ] { instance } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
168+ => Function ( "ST_ConvexHull" , [ instance ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
169169 nameof ( Geometry . CoveredBy )
170- => Function ( "ST_CoveredBy" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
170+ => Function ( "ST_CoveredBy" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
171171 nameof ( Geometry . Covers )
172- => Function ( "ST_Covers" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
172+ => Function ( "ST_Covers" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
173173 nameof ( Geometry . Crosses )
174- => Function ( "ST_Crosses" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
174+ => Function ( "ST_Crosses" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
175175 nameof ( Geometry . Disjoint )
176- => Function ( "ST_Disjoint" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
176+ => Function ( "ST_Disjoint" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
177177 nameof ( Geometry . Difference )
178- => Function ( "ST_Difference" , new [ ] { instance , arguments [ 0 ] } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
178+ => Function ( "ST_Difference" , [ instance , arguments [ 0 ] ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
179179 nameof ( Geometry . Distance )
180180 => Function ( "ST_Distance" , new [ ] { instance } . Concat ( arguments ) . ToArray ( ) , typeof ( double ) ) ,
181181 nameof ( Geometry . EqualsExact )
182- => Function ( "ST_OrderingEquals" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
182+ => Function ( "ST_OrderingEquals" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
183183 nameof ( Geometry . EqualsTopologically )
184- => Function ( "ST_Equals" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
184+ => Function ( "ST_Equals" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
185185 nameof ( Geometry . GetGeometryN )
186- => Function ( "ST_GeometryN" , new [ ] { instance , OneBased ( arguments [ 0 ] ) } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
186+ => Function ( "ST_GeometryN" , [ instance , OneBased ( arguments [ 0 ] ) ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
187187 nameof ( Polygon . GetInteriorRingN )
188- => Function ( "ST_InteriorRingN" , new [ ] { instance , OneBased ( arguments [ 0 ] ) } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
188+ => Function ( "ST_InteriorRingN" , [ instance , OneBased ( arguments [ 0 ] ) ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
189189 nameof ( LineString . GetPointN )
190- => Function ( "ST_PointN" , new [ ] { instance , OneBased ( arguments [ 0 ] ) } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
190+ => Function ( "ST_PointN" , [ instance , OneBased ( arguments [ 0 ] ) ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
191191 nameof ( Geometry . Intersection )
192- => Function ( "ST_Intersection" , new [ ] { instance , arguments [ 0 ] } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
192+ => Function ( "ST_Intersection" , [ instance , arguments [ 0 ] ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
193193 nameof ( Geometry . Intersects )
194- => Function ( "ST_Intersects" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
194+ => Function ( "ST_Intersects" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
195195 nameof ( Geometry . IsWithinDistance )
196196 => Function ( "ST_DWithin" , new [ ] { instance } . Concat ( arguments ) . ToArray ( ) , typeof ( bool ) ) ,
197197 nameof ( Geometry . Normalized )
198- => Function ( "ST_Normalize" , new [ ] { instance } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
198+ => Function ( "ST_Normalize" , [ instance ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
199199 nameof ( Geometry . Overlaps )
200- => Function ( "ST_Overlaps" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
200+ => Function ( "ST_Overlaps" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
201201 nameof ( Geometry . Relate )
202- => Function ( "ST_Relate" , new [ ] { instance , arguments [ 0 ] , arguments [ 1 ] } , typeof ( bool ) ) ,
202+ => Function ( "ST_Relate" , [ instance , arguments [ 0 ] , arguments [ 1 ] ] , typeof ( bool ) ) ,
203203 nameof ( Geometry . Reverse )
204- => Function ( "ST_Reverse" , new [ ] { instance } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
204+ => Function ( "ST_Reverse" , [ instance ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
205205 nameof ( Geometry . SymmetricDifference )
206- => Function ( "ST_SymDifference" , new [ ] { instance , arguments [ 0 ] } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
206+ => Function ( "ST_SymDifference" , [ instance , arguments [ 0 ] ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
207207 nameof ( Geometry . ToBinary )
208- => Function ( "ST_AsBinary" , new [ ] { instance } , typeof ( byte [ ] ) ) ,
208+ => Function ( "ST_AsBinary" , [ instance ] , typeof ( byte [ ] ) ) ,
209209 nameof ( Geometry . ToText )
210- => Function ( "ST_AsText" , new [ ] { instance } , typeof ( string ) ) ,
210+ => Function ( "ST_AsText" , [ instance ] , typeof ( string ) ) ,
211211 nameof ( Geometry . Touches )
212- => Function ( "ST_Touches" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
212+ => Function ( "ST_Touches" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
213213 nameof ( Geometry . Within )
214- => Function ( "ST_Within" , new [ ] { instance , arguments [ 0 ] } , typeof ( bool ) ) ,
214+ => Function ( "ST_Within" , [ instance , arguments [ 0 ] ] , typeof ( bool ) ) ,
215215 nameof ( Geometry . Union ) when arguments . Count == 0
216- => Function ( "ST_UnaryUnion" , new [ ] { instance } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
216+ => Function ( "ST_UnaryUnion" , [ instance ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
217217 nameof ( Geometry . Union ) when arguments . Count == 1
218- => Function ( "ST_Union" , new [ ] { instance , arguments [ 0 ] } , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
218+ => Function ( "ST_Union" , [ instance , arguments [ 0 ] ] , typeof ( Geometry ) , ResultGeometryMapping ( ) ) ,
219219
220220 _ => null
221221 } ;
0 commit comments