예제 #1
0
        /// <summary>Return all the keys that share a common prefix</summary>
        /// <param name="query">Source database query</param>
        /// <param name="prefix">Shared prefix</param>
        /// <returns>Query that will return the keys that share the specified <paramref name="prefix"/></returns>
        public static IFdbAsyncSequenceQueryable <KeyValuePair <Slice, Slice> > RangeStartsWith(this IFdbDatabaseQueryable query, Slice prefix)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            var expr = FdbQueryExpressions.RangeStartsWith(prefix);

            return(query.Provider.CreateSequenceQuery(expr));
        }
        /// <summary>Return a range of keys</summary>
        /// <param name="query">Source database query</param>
        /// <param name="range">Pair of key selectors</param>
        /// <returns>Query that will return the keys from the specified <paramref name="range"/></returns>
        public static IFdbAsyncSequenceQueryable <KeyValuePair <Slice, Slice> > Range(this IFdbDatabaseQueryable query, FdbKeySelectorPair range)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            var expr = FdbQueryExpressions.Range(range);

            return(query.Provider.CreateSequenceQuery(expr));
        }