So we have an AutoQuery DTO that successfully used a template to limit for a radius like so:
[QueryDbField(Template = "geography::Point({Value1}, {Value2}, 4326).STDistance({Field}) < 10000", Field = "GeoLocation")]
public double[] Within10KMRadiusOfLatLong { get; set; }
We would also like to order by the geography::Point({Value1}, {Value2}, 4326).STDistance({Field})
as a calculated return field Distance
.
The CustomSelectAttribute
looks to be half the answe,r but only handles static SQL expressions, it doesn’t have any provision to take in parameters.
Any ideas on existing Attributes which might achieve our goal? Or dowe have to build a custom request implementation for this query to get the functionality we desire.