Beispiel #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);
        }
        /// <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);
        }
Beispiel #3
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);
        }
        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);
        }
 internal static IQueryable <T> Queryable <T>(this IBucket bucket)
 {
     //TODO refactor so ClientConfiguration is injectable
     return(DocumentFilterManager.ApplyFilters(new BucketQueryable <T>(bucket, new ClientConfiguration())));
 }
 /// <summary>
 /// Queries the current <see cref="IBucket" /> for entities of type <see cref="T" />. This is the target of
 /// the Linq query requires that the associated JSON document have a type property that is the same as <see cref="T" />.
 /// </summary>
 /// <typeparam name="T">An entity or POCO representing the object graph of a JSON document.</typeparam>
 /// <returns></returns>
 public IQueryable <T> Query <T>()
 {
     return(DocumentFilterManager.ApplyFilters(new BucketQueryable <T>(_bucket, Configuration, EnableChangeTracking)));
 }
 /// <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>
 /// <returns><see cref="IQueryable{T}" /> which can be used to query the bucket.</returns>
 public IQueryable <T> Query <T>()
 {
     return(DocumentFilterManager.ApplyFilters(new BucketQueryable <T>(_bucket, Configuration, this)));
 }