Exemplo n.º 1
0
            public QueryingEnumerable(
                CosmosQueryContext cosmosQueryContext,
                ISqlExpressionFactory sqlExpressionFactory,
                IQuerySqlGeneratorFactory querySqlGeneratorFactory,
                SelectExpression selectExpression,
                Func <CosmosQueryContext, JObject, T> shaper,
                Type contextType,
                string partitionKeyFromExtension,
                IDiagnosticsLogger <DbLoggerCategory.Query> logger,
                bool performIdentityResolution)
            {
                _cosmosQueryContext       = cosmosQueryContext;
                _sqlExpressionFactory     = sqlExpressionFactory;
                _querySqlGeneratorFactory = querySqlGeneratorFactory;
                _selectExpression         = selectExpression;
                _shaper      = shaper;
                _contextType = contextType;
                _logger      = logger;
                _performIdentityResolution = performIdentityResolution;

                var partitionKey = selectExpression.GetPartitionKey(cosmosQueryContext.ParameterValues);

                if (partitionKey != null && partitionKeyFromExtension != null && partitionKeyFromExtension != partitionKey)
                {
                    throw new InvalidOperationException(CosmosStrings.PartitionKeyMismatch(partitionKeyFromExtension, partitionKey));
                }

                _partitionKey = partitionKey ?? partitionKeyFromExtension;
            }
            public QueryingEnumerable(
                CosmosQueryContext cosmosQueryContext,
                ISqlExpressionFactory sqlExpressionFactory,
                IQuerySqlGeneratorFactory querySqlGeneratorFactory,
                SelectExpression selectExpression,
                Func <CosmosQueryContext, JObject, T> shaper,
                Type contextType,
                string partitionKeyFromExtension,
                bool standAloneStateManager)
            {
                _cosmosQueryContext       = cosmosQueryContext;
                _sqlExpressionFactory     = sqlExpressionFactory;
                _querySqlGeneratorFactory = querySqlGeneratorFactory;
                _selectExpression         = selectExpression;
                _shaper                 = shaper;
                _contextType            = contextType;
                _queryLogger            = cosmosQueryContext.QueryLogger;
                _standAloneStateManager = standAloneStateManager;

                var partitionKey = selectExpression.GetPartitionKey(cosmosQueryContext.ParameterValues);

                if (partitionKey != null && partitionKeyFromExtension != null && partitionKeyFromExtension != partitionKey)
                {
                    throw new InvalidOperationException(CosmosStrings.PartitionKeyMismatch(partitionKeyFromExtension, partitionKey));
                }

                _partitionKey = partitionKey ?? partitionKeyFromExtension;
            }
 public Enumerator(QueryingEnumerable <T> queryingEnumerable)
 {
     _cosmosQueryContext       = queryingEnumerable._cosmosQueryContext;
     _shaper                   = queryingEnumerable._shaper;
     _selectExpression         = queryingEnumerable._selectExpression;
     _sqlExpressionFactory     = queryingEnumerable._sqlExpressionFactory;
     _querySqlGeneratorFactory = queryingEnumerable._querySqlGeneratorFactory;
     _contextType              = queryingEnumerable._contextType;
     _logger                   = queryingEnumerable._logger;
 }
Exemplo n.º 4
0
 public Enumerator(ReadItemQueryingEnumerable <T> readItemEnumerable, CancellationToken cancellationToken = default)
 {
     _cosmosQueryContext     = readItemEnumerable._cosmosQueryContext;
     _readItemExpression     = readItemEnumerable._readItemExpression;
     _shaper                 = readItemEnumerable._shaper;
     _contextType            = readItemEnumerable._contextType;
     _queryLogger            = readItemEnumerable._queryLogger;
     _standAloneStateManager = readItemEnumerable._standAloneStateManager;
     _cancellationToken      = cancellationToken;
 }
 public Enumerator(ReadItemQueryingEnumerable <T> readItemEnumerable, CancellationToken cancellationToken = default)
 {
     _cosmosQueryContext        = readItemEnumerable._cosmosQueryContext;
     _readItemExpression        = readItemEnumerable._readItemExpression;
     _shaper                    = readItemEnumerable._shaper;
     _contextType               = readItemEnumerable._contextType;
     _queryLogger               = readItemEnumerable._queryLogger;
     _performIdentityResolution = readItemEnumerable._performIdentityResolution;
     _cancellationToken         = cancellationToken;
 }
 public Enumerator(QueryingEnumerable <T> queryingEnumerable)
 {
     _queryingEnumerable        = queryingEnumerable;
     _cosmosQueryContext        = queryingEnumerable._cosmosQueryContext;
     _shaper                    = queryingEnumerable._shaper;
     _selectExpression          = queryingEnumerable._selectExpression;
     _contextType               = queryingEnumerable._contextType;
     _partitionKey              = queryingEnumerable._partitionKey;
     _queryLogger               = queryingEnumerable._queryLogger;
     _performIdentityResolution = queryingEnumerable._performIdentityResolution;
 }
 public Enumerator(QueryingEnumerable <T> queryingEnumerable)
 {
     _queryingEnumerable     = queryingEnumerable;
     _cosmosQueryContext     = queryingEnumerable._cosmosQueryContext;
     _shaper                 = queryingEnumerable._shaper;
     _selectExpression       = queryingEnumerable._selectExpression;
     _contextType            = queryingEnumerable._contextType;
     _partitionKey           = queryingEnumerable._partitionKey;
     _queryLogger            = queryingEnumerable._queryLogger;
     _standAloneStateManager = queryingEnumerable._standAloneStateManager;
 }
 public AsyncEnumerator(QueryingEnumerable <T> queryingEnumerable, CancellationToken cancellationToken)
 {
     _cosmosQueryContext       = queryingEnumerable._cosmosQueryContext;
     _shaper                   = queryingEnumerable._shaper;
     _selectExpression         = queryingEnumerable._selectExpression;
     _sqlExpressionFactory     = queryingEnumerable._sqlExpressionFactory;
     _querySqlGeneratorFactory = queryingEnumerable._querySqlGeneratorFactory;
     _contextType              = queryingEnumerable._contextType;
     _logger                   = queryingEnumerable._logger;
     _cancellationToken        = cancellationToken;
 }
 public AsyncEnumerator(QueryingEnumerable <T> queryingEnumerable, CancellationToken cancellationToken)
 {
     _queryingEnumerable     = queryingEnumerable;
     _cosmosQueryContext     = queryingEnumerable._cosmosQueryContext;
     _shaper                 = queryingEnumerable._shaper;
     _selectExpression       = queryingEnumerable._selectExpression;
     _contextType            = queryingEnumerable._contextType;
     _partitionKey           = queryingEnumerable._partitionKey;
     _queryLogger            = queryingEnumerable._queryLogger;
     _standAloneStateManager = queryingEnumerable._standAloneStateManager;
     _cancellationToken      = cancellationToken;
 }
Exemplo n.º 10
0
 public AsyncEnumerator(QueryingEnumerable <T> queryingEnumerable, CancellationToken cancellationToken)
 {
     _queryingEnumerable        = queryingEnumerable;
     _cosmosQueryContext        = queryingEnumerable._cosmosQueryContext;
     _shaper                    = queryingEnumerable._shaper;
     _selectExpression          = queryingEnumerable._selectExpression;
     _contextType               = queryingEnumerable._contextType;
     _partitionKey              = queryingEnumerable._partitionKey;
     _logger                    = queryingEnumerable._logger;
     _performIdentityResolution = queryingEnumerable._performIdentityResolution;
     _cancellationToken         = cancellationToken;
 }
 public ReadItemQueryingEnumerable(
     CosmosQueryContext cosmosQueryContext,
     ReadItemExpression readItemExpression,
     Func <CosmosQueryContext, JObject, T> shaper,
     Type contextType,
     IDiagnosticsLogger <DbLoggerCategory.Query> logger)
 {
     _cosmosQueryContext = cosmosQueryContext;
     _readItemExpression = readItemExpression;
     _shaper             = shaper;
     _contextType        = contextType;
     _logger             = logger;
 }
 public ReadItemQueryingEnumerable(
     CosmosQueryContext cosmosQueryContext,
     ReadItemExpression readItemExpression,
     Func <CosmosQueryContext, JObject, T> shaper,
     Type contextType,
     bool standAloneStateManager)
 {
     _cosmosQueryContext     = cosmosQueryContext;
     _readItemExpression     = readItemExpression;
     _shaper                 = shaper;
     _contextType            = contextType;
     _queryLogger            = _cosmosQueryContext.QueryLogger;
     _standAloneStateManager = standAloneStateManager;
 }
 public ReadItemQueryingEnumerable(
     CosmosQueryContext cosmosQueryContext,
     ReadItemExpression readItemExpression,
     Func <CosmosQueryContext, JObject, T> shaper,
     Type contextType,
     bool performIdentityResolution)
 {
     _cosmosQueryContext        = cosmosQueryContext;
     _readItemExpression        = readItemExpression;
     _shaper                    = shaper;
     _contextType               = contextType;
     _queryLogger               = _cosmosQueryContext.QueryLogger;
     _performIdentityResolution = performIdentityResolution;
 }
                protected ReadItemBase(
                    ReadItemQueryingEnumerable <T> readItemEnumerable)
                {
#pragma warning disable EF1001
                    _stateManager = readItemEnumerable._cosmosQueryContext.StateManager;
#pragma warning restore EF1001
                    CosmosQueryContext  = readItemEnumerable._cosmosQueryContext;
                    _readItemExpression = readItemEnumerable._readItemExpression;
                    _entityType         = readItemEnumerable._readItemExpression.EntityType;
                    CosmosClient        = readItemEnumerable._cosmosQueryContext.CosmosClient;
                    ContainerId         = _readItemExpression.Container;
                    Shaper      = readItemEnumerable._shaper;
                    ContextType = readItemEnumerable._contextType;
                    Logger      = readItemEnumerable._logger;
                }
                public Enumerator(QueryingEnumerable <T> queryingEnumerable)
                {
                    _queryingEnumerable     = queryingEnumerable;
                    _cosmosQueryContext     = queryingEnumerable._cosmosQueryContext;
                    _shaper                 = queryingEnumerable._shaper;
                    _selectExpression       = queryingEnumerable._selectExpression;
                    _contextType            = queryingEnumerable._contextType;
                    _partitionKey           = queryingEnumerable._partitionKey;
                    _queryLogger            = queryingEnumerable._queryLogger;
                    _standAloneStateManager = queryingEnumerable._standAloneStateManager;

                    _concurrencyDetector = queryingEnumerable._threadSafetyChecksEnabled
                        ? _cosmosQueryContext.ConcurrencyDetector
                        : null;
                }
Exemplo n.º 16
0
                public Enumerator(ReadItemQueryingEnumerable <T> readItemEnumerable, CancellationToken cancellationToken = default)
                {
                    _cosmosQueryContext     = readItemEnumerable._cosmosQueryContext;
                    _readItemExpression     = readItemEnumerable._readItemExpression;
                    _shaper                 = readItemEnumerable._shaper;
                    _contextType            = readItemEnumerable._contextType;
                    _queryLogger            = readItemEnumerable._queryLogger;
                    _standAloneStateManager = readItemEnumerable._standAloneStateManager;
                    _readItemEnumerable     = readItemEnumerable;
                    _cancellationToken      = cancellationToken;

                    _concurrencyDetector = readItemEnumerable._threadSafetyChecksEnabled
                        ? _cosmosQueryContext.ConcurrencyDetector
                        : null;
                }
 public QueryingEnumerable(
     CosmosQueryContext cosmosQueryContext,
     ISqlExpressionFactory sqlExpressionFactory,
     IQuerySqlGeneratorFactory querySqlGeneratorFactory,
     SelectExpression selectExpression,
     Func <QueryContext, JObject, T> shaper,
     Type contextType,
     IDiagnosticsLogger <DbLoggerCategory.Query> logger)
 {
     _cosmosQueryContext       = cosmosQueryContext;
     _sqlExpressionFactory     = sqlExpressionFactory;
     _querySqlGeneratorFactory = querySqlGeneratorFactory;
     _selectExpression         = selectExpression;
     _shaper      = shaper;
     _contextType = contextType;
     _logger      = logger;
 }