Skip to content

Commit

Permalink
Translate NTS EqualsExact to ST_OrderingEquals
Browse files Browse the repository at this point in the history
Fixes #1131
  • Loading branch information
roji committed Nov 25, 2019
1 parent d7f27b8 commit d6a2690
Showing 1 changed file with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,33 @@ public virtual SqlExpression Translate(SqlExpression instance, MethodInfo method

return method.Name switch
{
nameof(Geometry.AsBinary) => _sqlExpressionFactory.Function("ST_AsBinary", new[] { instance }, typeof(byte[])),
nameof(Geometry.AsText) => _sqlExpressionFactory.Function("ST_AsText", new[] { instance }, typeof(string)),
nameof(Geometry.Buffer) => _sqlExpressionFactory.Function("ST_Buffer", new[] { instance }.Concat(arguments), typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.Contains) => _sqlExpressionFactory.Function("ST_Contains", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.ConvexHull) => _sqlExpressionFactory.Function("ST_ConvexHull", new[] { instance }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.CoveredBy) => _sqlExpressionFactory.Function("ST_CoveredBy", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Covers) => _sqlExpressionFactory.Function("ST_Covers", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Crosses) => _sqlExpressionFactory.Function("ST_Crosses", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Disjoint) => _sqlExpressionFactory.Function("ST_Disjoint", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Difference) => _sqlExpressionFactory.Function("ST_Difference", new[] { instance, arguments[0] }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.Distance) => _sqlExpressionFactory.Function("ST_Distance", new[] { instance, arguments[0] }, typeof(double)),
nameof(Geometry.EqualsExact) => _sqlExpressionFactory.Equal(instance, arguments[0]),
nameof(Geometry.EqualsTopologically) => _sqlExpressionFactory.Function("ST_Equals", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.GetGeometryN) => _sqlExpressionFactory.Function("ST_GeometryN", new[] { instance, OneBased(arguments[0]) }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Polygon.GetInteriorRingN) => _sqlExpressionFactory.Function("ST_InteriorRingN", new[] { instance, OneBased(arguments[0]) }, typeof(Geometry), resultGeometryTypeMapping),
nameof(LineString.GetPointN) => _sqlExpressionFactory.Function("ST_PointN", new[] { instance, OneBased(arguments[0]) }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.Intersection) => _sqlExpressionFactory.Function("ST_Intersection", new[] { instance, arguments[0] }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.Intersects) => _sqlExpressionFactory.Function("ST_Intersects", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.IsWithinDistance) => _sqlExpressionFactory.Function("ST_DWithin", new[] { instance, arguments[0], arguments[1] }, typeof(bool)),
nameof(Geometry.Overlaps) => _sqlExpressionFactory.Function("ST_Overlaps", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Relate) => _sqlExpressionFactory.Function("ST_Relate", new[] { instance, arguments[0], arguments[1] }, typeof(bool)),
nameof(Geometry.Reverse) => _sqlExpressionFactory.Function("ST_Reverse", new[] { instance }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.SymmetricDifference) => _sqlExpressionFactory.Function("ST_SymDifference", new[] { instance, arguments[0] }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.ToBinary) => _sqlExpressionFactory.Function("ST_AsBinary", new[] { instance }, typeof(byte[])),
nameof(Geometry.ToText) => _sqlExpressionFactory.Function("ST_AsText", new[] { instance }, typeof(string)),
nameof(Geometry.Touches) => _sqlExpressionFactory.Function("ST_Touches", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Within) => _sqlExpressionFactory.Function("ST_Within", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.AsBinary) => _sqlExpressionFactory.Function("ST_AsBinary", new[] { instance }, typeof(byte[])),
nameof(Geometry.AsText) => _sqlExpressionFactory.Function("ST_AsText", new[] { instance }, typeof(string)),
nameof(Geometry.Buffer) => _sqlExpressionFactory.Function("ST_Buffer", new[] { instance }.Concat(arguments), typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.Contains) => _sqlExpressionFactory.Function("ST_Contains", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.ConvexHull) => _sqlExpressionFactory.Function("ST_ConvexHull", new[] { instance }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.CoveredBy) => _sqlExpressionFactory.Function("ST_CoveredBy", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Covers) => _sqlExpressionFactory.Function("ST_Covers", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Crosses) => _sqlExpressionFactory.Function("ST_Crosses", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Disjoint) => _sqlExpressionFactory.Function("ST_Disjoint", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Difference) => _sqlExpressionFactory.Function("ST_Difference", new[] { instance, arguments[0] }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.Distance) => _sqlExpressionFactory.Function("ST_Distance", new[] { instance, arguments[0] }, typeof(double)),
nameof(Geometry.EqualsExact) => _sqlExpressionFactory.Function("ST_OrderingEquals", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.EqualsTopologically) => _sqlExpressionFactory.Function("ST_Equals", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.GetGeometryN) => _sqlExpressionFactory.Function("ST_GeometryN", new[] { instance, OneBased(arguments[0]) }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Polygon.GetInteriorRingN) => _sqlExpressionFactory.Function("ST_InteriorRingN", new[] { instance, OneBased(arguments[0]) }, typeof(Geometry), resultGeometryTypeMapping),
nameof(LineString.GetPointN) => _sqlExpressionFactory.Function("ST_PointN", new[] { instance, OneBased(arguments[0]) }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.Intersection) => _sqlExpressionFactory.Function("ST_Intersection", new[] { instance, arguments[0] }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.Intersects) => _sqlExpressionFactory.Function("ST_Intersects", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.IsWithinDistance) => _sqlExpressionFactory.Function("ST_DWithin", new[] { instance, arguments[0], arguments[1] }, typeof(bool)),
nameof(Geometry.Overlaps) => _sqlExpressionFactory.Function("ST_Overlaps", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Relate) => _sqlExpressionFactory.Function("ST_Relate", new[] { instance, arguments[0], arguments[1] }, typeof(bool)),
nameof(Geometry.Reverse) => _sqlExpressionFactory.Function("ST_Reverse", new[] { instance }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.SymmetricDifference) => _sqlExpressionFactory.Function("ST_SymDifference", new[] { instance, arguments[0] }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.ToBinary) => _sqlExpressionFactory.Function("ST_AsBinary", new[] { instance }, typeof(byte[])),
nameof(Geometry.ToText) => _sqlExpressionFactory.Function("ST_AsText", new[] { instance }, typeof(string)),
nameof(Geometry.Touches) => _sqlExpressionFactory.Function("ST_Touches", new[] { instance, arguments[0] }, typeof(bool)),
nameof(Geometry.Within) => _sqlExpressionFactory.Function("ST_Within", new[] { instance, arguments[0] }, typeof(bool)),

nameof(Geometry.Union) when arguments.Count == 0 => _sqlExpressionFactory.Function("ST_UnaryUnion", new[] { instance }, typeof(Geometry), resultGeometryTypeMapping),
nameof(Geometry.Union) when arguments.Count == 1 => _sqlExpressionFactory.Function("ST_Union", new[] { instance, arguments[0] }, typeof(Geometry), resultGeometryTypeMapping),
Expand Down

0 comments on commit d6a2690

Please sign in to comment.