Exemplo n.º 1
0
        /// <summary>
        /// <para>SortGeoDistance() allows you to sort by a distance from a geo point.
        /// </para>
        /// </summary>
        public SearchDescriptor <T> SortGeoDistance(Func <SortGeoDistanceDescriptor <T>, SortGeoDistanceDescriptor <T> > sortSelector)
        {
            if (this._Sort == null)
            {
                this._Sort = new Dictionary <PropertyPathMarker, object>();
            }

            sortSelector.ThrowIfNull("sortSelector");
            var descriptor = new SortGeoDistanceDescriptor <T>();

            sortSelector(descriptor);
            this._Sort.Add("_geo_distance", descriptor);
            return(this);
        }
Exemplo n.º 2
0
        /// <summary>
        /// <para>SortGeoDistance() allows you to sort by a distance from a geo point.
        /// </para>
        /// </summary>
        public SearchDescriptor <T> SortGeoDistance(Func <SortGeoDistanceDescriptor <T>, SortGeoDistanceDescriptor <T> > sortSelector)
        {
            if (this._Sort == null)
            {
                this._Sort = new Dictionary <string, object>();
            }

            sortSelector.ThrowIfNull("sortSelector");
            var descriptor = new SortGeoDistanceDescriptor <T>();

            sortSelector(descriptor);
            this._Sort.Add(descriptor._Field, descriptor);
            return(this);
        }