コード例 #1
0
        public QueryCompilationContextDependencies(
            [NotNull] IModel model,
            [NotNull] IQueryOptimizerFactory queryOptimizerFactory,
            [NotNull] IQueryableMethodTranslatingExpressionVisitorFactory queryableMethodTranslatingExpressionVisitorFactory,
            [NotNull] IShapedQueryOptimizerFactory shapedQueryOptimizerFactory,
            [NotNull] IShapedQueryCompilingExpressionVisitorFactory shapedQueryCompilingExpressionVisitorFactory,
            [NotNull] ICurrentDbContext currentContext,
            [NotNull] IDbContextOptions contextOptions,
            [NotNull] IDiagnosticsLogger <DbLoggerCategory.Query> logger)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(queryOptimizerFactory, nameof(queryOptimizerFactory));
            Check.NotNull(queryableMethodTranslatingExpressionVisitorFactory, nameof(queryableMethodTranslatingExpressionVisitorFactory));
            Check.NotNull(shapedQueryOptimizerFactory, nameof(shapedQueryOptimizerFactory));
            Check.NotNull(shapedQueryCompilingExpressionVisitorFactory, nameof(shapedQueryCompilingExpressionVisitorFactory));
            Check.NotNull(currentContext, nameof(currentContext));
            Check.NotNull(contextOptions, nameof(contextOptions));
            Check.NotNull(logger, nameof(logger));

            CurrentContext        = currentContext;
            Model                 = model;
            QueryOptimizerFactory = queryOptimizerFactory;
            QueryableMethodTranslatingExpressionVisitorFactory = queryableMethodTranslatingExpressionVisitorFactory;
            ShapedQueryOptimizerFactory = shapedQueryOptimizerFactory;
            ShapedQueryCompilingExpressionVisitorFactory = shapedQueryCompilingExpressionVisitorFactory;
            ContextOptions = contextOptions;
            Logger         = logger;
        }
コード例 #2
0
        public QueryCompilationContext(
            IModel model,
            IQueryOptimizerFactory queryOptimizerFactory,
            IEntityQueryableTranslatorFactory entityQuerableTranslatorFactory,
            IQueryableMethodTranslatingExpressionVisitorFactory queryableMethodTranslatingExpressionVisitorFactory,
            IShapedQueryOptimizerFactory shapedQueryOptimizerFactory,
            IShapedQueryCompilingExpressionVisitorFactory shapedQueryCompilingExpressionVisitorFactory,
            ICurrentDbContext currentDbContext,
            IDbContextOptions contextOptions,
            IDiagnosticsLogger <DbLoggerCategory.Query> logger,
            bool async)
        {
            Async             = async;
            TrackQueryResults = currentDbContext.Context.ChangeTracker.QueryTrackingBehavior == QueryTrackingBehavior.TrackAll;
            Model             = model;
            ContextOptions    = contextOptions;
            ContextType       = currentDbContext.Context.GetType();
            Logger            = logger;

            _queryOptimizerFactory            = queryOptimizerFactory;
            _entityQueryableTranslatorFactory = entityQuerableTranslatorFactory;
            _queryableMethodTranslatingExpressionVisitorFactory = queryableMethodTranslatingExpressionVisitorFactory;
            _shapedQueryOptimizerFactory = shapedQueryOptimizerFactory;
            _shapedQueryCompilingExpressionVisitorFactory = shapedQueryCompilingExpressionVisitorFactory;
        }
コード例 #3
0
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="shapedQueryOptimizerFactory"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public QueryCompilationContextDependencies With([NotNull] IShapedQueryOptimizerFactory shapedQueryOptimizerFactory)
 => new QueryCompilationContextDependencies(
     Model,
     QueryOptimizerFactory,
     QueryableMethodTranslatingExpressionVisitorFactory,
     shapedQueryOptimizerFactory,
     ShapedQueryCompilingExpressionVisitorFactory,
     CurrentContext,
     ContextOptions,
     Logger);
コード例 #4
0
 public QueryCompilationContextFactory2(
     IModel model,
     IQueryOptimizerFactory queryOptimizerFactory,
     IEntityQueryableTranslatorFactory entityQueryableTranslatorFactory,
     IQueryableMethodTranslatingExpressionVisitorFactory queryableMethodTranslatingExpressionVisitorFactory,
     IShapedQueryOptimizerFactory shapedQueryOptimizerFactory,
     IShapedQueryCompilingExpressionVisitorFactory shapedQueryCompilingExpressionVisitorFactory,
     ICurrentDbContext currentDbContext)
 {
     _model = model;
     _queryOptimizerFactory            = queryOptimizerFactory;
     _entityQueryableTranslatorFactory = entityQueryableTranslatorFactory;
     _queryableMethodTranslatingExpressionVisitorFactory = queryableMethodTranslatingExpressionVisitorFactory;
     _shapedQueryOptimizerFactory = shapedQueryOptimizerFactory;
     _shapedQueryCompilingExpressionVisitorFactory = shapedQueryCompilingExpressionVisitorFactory;
     _currentDbContext = currentDbContext;
 }
コード例 #5
0
        public QueryCompilationContext(
            QueryCompilationContextDependencies dependencies,
            bool async)
        {
            var context = dependencies.CurrentContext.Context;

            IsAsync        = async;
            IsTracking     = context.ChangeTracker.QueryTrackingBehavior == QueryTrackingBehavior.TrackAll;
            Model          = dependencies.Model;
            ContextOptions = dependencies.ContextOptions;
            ContextType    = context.GetType();
            Logger         = dependencies.Logger;

            _queryOptimizerFactory = dependencies.QueryOptimizerFactory;
            _queryableMethodTranslatingExpressionVisitorFactory = dependencies.QueryableMethodTranslatingExpressionVisitorFactory;
            _shapedQueryOptimizerFactory = dependencies.ShapedQueryOptimizerFactory;
            _shapedQueryCompilingExpressionVisitorFactory = dependencies.ShapedQueryCompilingExpressionVisitorFactory;
        }
コード例 #6
0
 public QueryCompilationContextFactory(
     IModel model,
     IQueryOptimizerFactory queryOptimizerFactory,
     IQueryableMethodTranslatingExpressionVisitorFactory queryableMethodTranslatingExpressionVisitorFactory,
     IShapedQueryOptimizerFactory shapedQueryOptimizerFactory,
     IShapedQueryCompilingExpressionVisitorFactory shapedQueryCompilingExpressionVisitorFactory,
     ICurrentDbContext currentDbContext,
     IDbContextOptions contextOptions,
     IDiagnosticsLogger <DbLoggerCategory.Query> logger)
 {
     _model = model;
     _queryOptimizerFactory = queryOptimizerFactory;
     _queryableMethodTranslatingExpressionVisitorFactory = queryableMethodTranslatingExpressionVisitorFactory;
     _shapedQueryOptimizerFactory = shapedQueryOptimizerFactory;
     _shapedQueryCompilingExpressionVisitorFactory = shapedQueryCompilingExpressionVisitorFactory;
     _currentDbContext = currentDbContext;
     _contextOptions   = contextOptions;
     _logger           = logger;
 }
コード例 #7
0
 public QueryCompilationContext2(
     IModel model,
     IQueryOptimizerFactory queryOptimizerFactory,
     IEntityQueryableTranslatorFactory entityQuerableTranslatorFactory,
     IQueryableMethodTranslatingExpressionVisitorFactory queryableMethodTranslatingExpressionVisitorFactory,
     IShapedQueryOptimizerFactory shapedQueryOptimizerFactory,
     IShapedQueryCompilingExpressionVisitorFactory shapedQueryCompilingExpressionVisitorFactory,
     ICurrentDbContext currentDbContext,
     bool async)
 {
     Async                             = async;
     TrackQueryResults                 = currentDbContext.Context.ChangeTracker.QueryTrackingBehavior == QueryTrackingBehavior.TrackAll;
     Model                             = model;
     _queryOptimizerFactory            = queryOptimizerFactory;
     _entityQueryableTranslatorFactory = entityQuerableTranslatorFactory;
     _queryableMethodTranslatingExpressionVisitorFactory = queryableMethodTranslatingExpressionVisitorFactory;
     _shapedQueryOptimizerFactory = shapedQueryOptimizerFactory;
     _shapedQueryCompilingExpressionVisitorFactory = shapedQueryCompilingExpressionVisitorFactory;
 }