/// <summary>
        /// Adds a search parameter to search in a specific field for a match for a value.
        /// Not to be confused with the <see cref="FullTextSearch"/> method that searches across all fields.
        /// </summary>
        /// <param name="selector">The expression of the field to search for matches.</param>
        /// <param name="value">The value the field must match.</param>
        /// <returns>The <see cref="QueryBuilder{T}"/> instance.</returns>
        public QueryBuilder <T> FieldMatches <U>(Expression <Func <T, U> > selector, string value)
        {
            var memberName = FieldHelpers <T> .GetPropertyName(selector);

            return(FieldMatches(memberName, value));
        }
        /// <summary>
        /// Adds a search parameter on proximity of a coordinate of a location field.
        /// </summary>
        /// <param name="selector">The expression of a location field to check proximity for.</param>
        /// <param name="coordinate">The coordinate.</param>
        /// <returns>The <see cref="QueryBuilder{T}"/> instance.</returns>
        public QueryBuilder <T> InProximityOf <U>(Expression <Func <T, U> > selector, string coordinate)
        {
            var memberName = FieldHelpers <T> .GetPropertyName(selector);

            return(InProximityOf(memberName, coordinate));
        }
        /// <summary>
        /// Adds a restriction that a certain field must be greater than the specified value.
        /// </summary>
        /// <param name="selector">The expression of the field to compare against.</param>
        /// <param name="value">The value the field must be greater than.</param>
        /// <returns>The <see cref="QueryBuilder{T}"/> instance.</returns>
        public QueryBuilder <T> FieldGreaterThanOrEqualTo <U>(Expression <Func <T, U> > selector, string value)
        {
            var memberName = FieldHelpers <T> .GetPropertyName(selector);

            return(FieldGreaterThanOrEqualTo(memberName, value));
        }
        /// <summary>
        /// Adds a restriction that a certain field must exist and not be null.
        /// </summary>
        /// <param name="selector">The expression of the field that must exist and also not be null.</param>
        /// <param name="mustExist">Whether or not the field must exist or not exist. A value of false means only include entries where the particular field does NOT exist.</param>
        /// <returns>The <see cref="QueryBuilder{T}"/> instance.</returns>
        public QueryBuilder <T> FieldExists <U>(Expression <Func <T, U> > selector, bool mustExist = true)
        {
            var memberName = FieldHelpers <T> .GetPropertyName(selector);

            return(FieldExists(memberName, mustExist));
        }
        /// <summary>
        /// Adds a restriction that a certain field must not include any of the specified values.
        /// </summary>
        /// <param name="selector">The expression of the field that must not contain any of the specified values.</param>
        /// <param name="values">The values that the field must not include any of.</param>
        /// <returns>The <see cref="QueryBuilder{T}"/> instance.</returns>
        public QueryBuilder <T> FieldExcludes <U>(Expression <Func <T, U> > selector, IEnumerable <string> values)
        {
            var memberName = FieldHelpers <T> .GetPropertyName(selector);

            return(FieldExcludes(memberName, values));
        }
        /// <summary>
        /// Adds a restriction parameter to only return resources with a location field within a certain radius of a coordinate.
        /// </summary>
        /// <param name="selector">The expression of the location field to check if it is within the radius.</param>
        /// <param name="latitude1">The latitude of the centre of the bounding circle.</param>
        /// <param name="longitude1">The longitude of the centre of the bounding circle.</param>
        /// <param name="radius">The radius in kilometers of the bounding circle.</param>
        /// <returns>The <see cref="QueryBuilder{T}"/> instance.</returns>
        public QueryBuilder <T> WithinRadius <U>(Expression <Func <T, U> > selector, string latitude1, string longitude1, float radius)
        {
            var memberName = FieldHelpers <T> .GetPropertyName(selector);

            return(WithinRadius(memberName, latitude1, longitude1, radius));
        }
예제 #7
0
        /// <summary>
        /// Adds another field to sort by to the current <see cref="SortOrderBuilder{T}"/>.
        /// </summary>
        /// <param name="selector">The expression of the field to sort by.</param>
        /// <param name="order">The order of the sorting. Default is <see cref="SortOrder.Normal"/>.</param>
        /// <returns>The <see cref="SortOrderBuilder{T}"/> instance.</returns>
        public SortOrderBuilder <T> ThenBy <U>(Expression <Func <T, U> > selector, SortOrder order = SortOrder.Normal)
        {
            var memberName = FieldHelpers <T> .GetPropertyName(selector);

            return(ThenBy(memberName, order));
        }