Example #1
0
        public CosmosLinqQuery(
            ContainerInternal container,
            CosmosResponseFactoryInternal responseFactory,
            CosmosQueryClientCore queryClient,
            string continuationToken,
            QueryRequestOptions cosmosQueryRequestOptions,
            Expression expression,
            bool allowSynchronousQueryExecution,
            CosmosSerializationOptions serializationOptions = null)
        {
            this.container                      = container ?? throw new ArgumentNullException(nameof(container));
            this.responseFactory                = responseFactory ?? throw new ArgumentNullException(nameof(responseFactory));
            this.queryClient                    = queryClient ?? throw new ArgumentNullException(nameof(queryClient));
            this.continuationToken              = continuationToken;
            this.cosmosQueryRequestOptions      = cosmosQueryRequestOptions;
            this.Expression                     = expression ?? Expression.Constant(this);
            this.allowSynchronousQueryExecution = allowSynchronousQueryExecution;
            this.correlatedActivityId           = Guid.NewGuid();
            this.serializationOptions           = serializationOptions;

            this.queryProvider = new CosmosLinqQueryProvider(
                container,
                responseFactory,
                queryClient,
                this.continuationToken,
                cosmosQueryRequestOptions,
                this.allowSynchronousQueryExecution,
                this.queryClient.OnExecuteScalarQueryCallback,
                this.serializationOptions);
        }
Example #2
0
 public CosmosLinqQuery(
     ContainerInternal container,
     CosmosResponseFactoryInternal responseFactory,
     CosmosQueryClientCore queryClient,
     string continuationToken,
     QueryRequestOptions cosmosQueryRequestOptions,
     bool allowSynchronousQueryExecution,
     CosmosSerializationOptions serializationOptions = null)
     : this(
         container,
         responseFactory,
         queryClient,
         continuationToken,
         cosmosQueryRequestOptions,
         null,
         allowSynchronousQueryExecution,
         serializationOptions)
 {
 }
 public CosmosLinqQueryProvider(
     ContainerInternal container,
     CosmosResponseFactoryInternal responseFactory,
     CosmosQueryClientCore queryClient,
     string continuationToken,
     QueryRequestOptions cosmosQueryRequestOptions,
     bool allowSynchronousQueryExecution,
     Action <IQueryable> onExecuteScalarQueryCallback = null,
     CosmosSerializationOptions serializationOptions  = null)
 {
     this.container                      = container;
     this.responseFactory                = responseFactory;
     this.queryClient                    = queryClient;
     this.continuationToken              = continuationToken;
     this.cosmosQueryRequestOptions      = cosmosQueryRequestOptions;
     this.allowSynchronousQueryExecution = allowSynchronousQueryExecution;
     this.onExecuteScalarQueryCallback   = onExecuteScalarQueryCallback;
     this.serializationOptions           = serializationOptions;
 }