/// <summary> /// Initializes a new instance of the <see cref="AggregateDocumentQueryExecutionContext{T}"/> class. /// </summary> /// <param name="container">The <see cref="Container"/> object to use to interact with the Cosmos database /// when executing aggregate document queries.</param> /// <param name="queryOptions">Specifies the options for the aggregate query.</param> /// <param name="expression">The expression representing the query for aggregate data.</param> public AggregateDocumentQueryExecutionContext(Container container, AggregateQueryOptions queryOptions, Expression expression) { _container = container; _expression = expression; _queryOptions = queryOptions; }
/// <summary> /// Creates a query for aggregating data from documents in the Azure Cosmos DB service. /// </summary> /// <typeparam name="T">The type of the source documents.</typeparam> /// <param name="container">The document client to use to aggregate documents.</param> /// <param name="queryOptions">Specifies the options for the aggregate query.</param> /// <returns>A query for aggregating data from documents.</returns> public static IAggregateQueryable <T> CreateAggregateDocumentQuery <T>( this Container container, AggregateQueryOptions queryOptions) { Guard.ArgumentIsNotNull(nameof(container), container); return(new AggregateDocumentQuery <T>(container, queryOptions)); }
/// <summary> /// Initializes a new instance of the <see cref="AggregateDocumentQuery{T}"/> class. /// </summary> /// <param name="container">The <see cref="Container"/> object to use to interact with the Cosmos database /// when executing aggregate document queries.</param> /// <param name="queryOptions">Specifies the options for the aggregate query.</param> /// <param name="expression">The expression representing the query for aggregate data, or <c>null</c> if /// this is the initial <see cref="AggregateDocumentQuery{T}"/> being created for a query.</param> public AggregateDocumentQuery(Container container, AggregateQueryOptions queryOptions, Expression expression) { _container = container; _queryOptions = queryOptions; Expression = expression ?? Expression.Constant(this); Provider = new AggregateQueryProvider(container, queryOptions); }
/// <summary> /// Initializes a new instance of the <see cref="AggregateQueryProvider"/> class. /// </summary> /// <param name="container">The <see cref="Container"/> object to use to interact with the Cosmos database /// when executing aggregate document queries.</param> /// <param name="queryOptions">Specifies the options for the aggregate query.</param> public AggregateQueryProvider(Container container, AggregateQueryOptions queryOptions) { _container = Guard.ArgumentIsNotNull(nameof(container), container); _queryOptions = Guard.ArgumentIsNotNull(nameof(queryOptions), queryOptions); }
/// <summary> /// Initializes a new instance of the <see cref="AggregateDocumentQuery{T}"/> class. /// </summary> /// <param name="container">The <see cref="Container"/> object to use to interact with the Cosmos database /// when executing aggregate document queries.</param> /// <param name="queryOptions">Specifies the options for the aggregate query.</param> public AggregateDocumentQuery(Container container, AggregateQueryOptions queryOptions) : this(container, queryOptions, null) { }