Example #1
0
        /// <summary>
        /// Sorts the query results by distance.
        /// </summary>
        IAsyncDocumentQuery <T> IDocumentQueryBase <T, IAsyncDocumentQuery <T> > .SortByDistance()
        {
            var asyncSpatialDocumentQuery = new AsyncSpatialDocumentQuery <T>(this);

            asyncSpatialDocumentQuery.OrderBy(Constants.DistanceFieldName);
            return(asyncSpatialDocumentQuery);
        }
Example #2
0
        /// <summary>
        /// Filter matches to be inside the specified radius
        /// </summary>
        /// <param name="radius">The radius.</param>
        /// <param name="latitude">The latitude.</param>
        /// <param name="longitude">The longitude.</param>
        protected override object GenerateQueryWithinRadiusOf(double radius, double latitude, double longitude)
        {
            var spatialDocumentQuery = new AsyncSpatialDocumentQuery <T>(this, radius, latitude, longitude);

            if (negate)
            {
                negate = false;
                spatialDocumentQuery.NegateNext();
            }
            return(spatialDocumentQuery);
        }