示例#1
0
        internal IQueryable <T> Query <T>(string scope, string collection, BucketQueryOptions options = BucketQueryOptions.None)
        {
            IQueryable <T> query = new CollectionQueryable <T>(Bucket.Scope(scope).Collection(collection), QueryTimeout);

            if ((options & BucketQueryOptions.SuppressFilters) == BucketQueryOptions.None)
            {
                query = _documentFilterManager.ApplyFilters(query);
            }

            return(query);
        }
示例#2
0
        /// <inheritdoc />
        public IQueryable <T> Query <T>(BucketQueryOptions options)
        {
            IQueryable <T> query = new CollectionQueryable <T>(Bucket.DefaultCollection(), QueryTimeout);

            if ((options & BucketQueryOptions.SuppressFilters) == BucketQueryOptions.None)
            {
                query = _documentFilterManager.ApplyFilters(query);
            }

            return(query);
        }
        /// <summary>
        /// Queries the current <see cref="IBucket" /> for entities of type T. This is the target of
        /// a LINQ query and requires that the associated JSON document have a type property that is the same as T.
        /// </summary>
        /// <typeparam name="T">An entity or POCO representing the object graph of a JSON document.</typeparam>
        /// <param name="options">Options to control the returned query.</param>
        /// <returns><see cref="IQueryable{T}" /> which can be used to query the bucket.</returns>
        public IQueryable <T> Query <T>(BucketQueryOptions options)
        {
            IQueryable <T> query = new BucketQueryable <T>(Bucket, Configuration, this);

            if ((options & BucketQueryOptions.SuppressFilters) == BucketQueryOptions.None)
            {
                query = DocumentFilterManager.ApplyFilters(query);
            }

            return(query);
        }
        public IQueryable <T> Query <T>(BucketQueryOptions options)
        {
            var query = _bucket.Select(p => p.Value?.Content).OfType <T>().AsQueryable();

            if ((options & BucketQueryOptions.SuppressFilters) == BucketQueryOptions.None)
            {
                query = DocumentFilterManager.ApplyFilters(query);
            }

            return(query);
        }
示例#5
0
        /// <inheritdoc />
        public IQueryable <T> Query <T>(BucketQueryOptions options)
        {
            var(scope, collection) = CollectionMetadataCache.Instance.GetCollection <T>();

            return(Query <T>(scope, collection, options));
        }