public CustomQueryProvider(DbConnection connection,
                            ISqlExpressionVisitorFactory sqlGeneratorFactory,
                            IModelBuilder modelBuilder,
                            ILogger logger)
     : base(connection, sqlGeneratorFactory, modelBuilder, logger)
 {
 }
 public CustomQueryProvider(ConnectionStringSettings connectionString,
                            ISqlExpressionVisitorFactory sqlGeneratorFactory,
                            IModelBuilder modelBuilder,
                            ILogger logger)
     : base(connectionString, sqlGeneratorFactory, modelBuilder, logger)
 {
 }
 public CustomQueryProvider(DbConnection connection,
                            ISqlExpressionVisitorFactory sqlGeneratorFactory,
                            IModelBuilder modelBuilder,
                            ILogger logger)
     : base(connection, sqlGeneratorFactory, modelBuilder, logger, Substitute.For <IDatabaseMapper>())
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="QueryProvider" /> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="sqlGeneratorFactory">The SQL generator factory.</param>
 /// <param name="modelBuilder">The model builder.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="databaseMapper">The Database mapper.</param>
 public SqlServerQueryProvider(
     DbConnection connection,
     ISqlExpressionVisitorFactory sqlGeneratorFactory,
     IModelBuilder modelBuilder,
     ILogger logger,
     IDatabaseMapper databaseMapper)
     : base(connection, sqlGeneratorFactory, modelBuilder, logger, databaseMapper)
 {
 }
Example #5
0
 public FakeQueryProvider(
     DbConnection sqlConnection,
     ISqlExpressionVisitorFactory visitorFactory,
     IDatabaseMapper databaseMapper)
     : base(sqlConnection,
            visitorFactory,
            Substitute.For <IModelBuilder>(),
            Substitute.For <ILogger>(),
            databaseMapper)
 {
     _sqlConnection  = sqlConnection;
     _visitorFactory = visitorFactory;
 }
Example #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueryProvider" /> class.
        /// </summary>
        /// <param name="externalConnection">The connection.</param>
        /// <param name="sqlGeneratorFactory">The SQL generator factory.</param>
        /// <param name="modelBuilder">The model builder.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="databaseMapper">The Database mapper.</param>
        public QueryProvider(
            DbConnection externalConnection,
            ISqlExpressionVisitorFactory sqlGeneratorFactory,
            IModelBuilder modelBuilder,
            ILogger logger,
            IDatabaseMapper databaseMapper)
        {
            _connection     = Check.NotNull(externalConnection, nameof(externalConnection));
            _modelBuilder   = Check.NotNull(modelBuilder, nameof(modelBuilder));
            _logger         = Check.NotNull(logger, nameof(logger));
            _databaseMapper = Check.NotNull(databaseMapper, nameof(databaseMapper));

            InitSqlExpressionVisitor(Check.NotNull(sqlGeneratorFactory, nameof(sqlGeneratorFactory)));
            IsExternalConnection = true;
            _transactionHelper   = new Lazy <TransactionHelper>(() => new TransactionHelper(Connection));
        }
Example #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueryProvider" /> class.
        /// </summary>
        /// <param name="connectionSettings">The connection string settings.</param>
        /// <param name="sqlGeneratorFactory">The SQL generator factory.</param>
        /// <param name="modelBuilder">The model builder.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="databaseMapper">The Database mapper.</param>
        public QueryProvider(
            KormConnectionSettings connectionSettings,
            ISqlExpressionVisitorFactory sqlGeneratorFactory,
            IModelBuilder modelBuilder,
            ILogger logger,
            IDatabaseMapper databaseMapper)
        {
            _logger             = Check.NotNull(logger, nameof(logger));
            _databaseMapper     = Check.NotNull(databaseMapper, nameof(databaseMapper));
            _connectionSettings = Check.NotNull(connectionSettings, nameof(connectionSettings));

            InitSqlExpressionVisitor(Check.NotNull(sqlGeneratorFactory, nameof(sqlGeneratorFactory)));
            IsExternalConnection = false;
            _modelBuilder        = Check.NotNull(modelBuilder, nameof(modelBuilder));
            _transactionHelper   = new Lazy <TransactionHelper>(() => new TransactionHelper(Connection));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueryProvider" /> class.
        /// </summary>
        /// <param name="externalConnection">The connection.</param>
        /// <param name="sqlGeneratorFactory">The SQL generator factory.</param>
        /// <param name="modelBuilder">The model builder.</param>
        /// <param name="logger">The logger.</param>
        public QueryProvider(
            DbConnection externalConnection,
            ISqlExpressionVisitorFactory sqlGeneratorFactory,
            IModelBuilder modelBuilder,
            ILogger logger)
        {
            Check.NotNull(externalConnection, nameof(externalConnection));
            Check.NotNull(sqlGeneratorFactory, nameof(sqlGeneratorFactory));
            Check.NotNull(modelBuilder, nameof(modelBuilder));
            Check.NotNull(logger, nameof(logger));

            _logger              = logger;
            _connection          = externalConnection;
            IsExternalConnection = true;
            _sqlGeneratorFactory = sqlGeneratorFactory;
            _modelBuilder        = modelBuilder;
            _transactionHelper   = new Lazy <TransactionHelper>(() => new TransactionHelper(Connection));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueryProvider" /> class.
        /// </summary>
        /// <param name="connectionSettings">The connection string settings.</param>
        /// <param name="sqlGeneratorFactory">The SQL generator factory.</param>
        /// <param name="modelBuilder">The model builder.</param>
        /// <param name="logger">The logger.</param>
        public QueryProvider(
            KormConnectionSettings connectionSettings,
            ISqlExpressionVisitorFactory sqlGeneratorFactory,
            IModelBuilder modelBuilder,
            ILogger logger)
        {
            Check.NotNull(connectionSettings, nameof(connectionSettings));
            Check.NotNull(sqlGeneratorFactory, nameof(sqlGeneratorFactory));
            Check.NotNull(modelBuilder, nameof(modelBuilder));
            Check.NotNull(logger, nameof(logger));

            _logger              = logger;
            _connectionSettings  = connectionSettings;
            IsExternalConnection = false;
            _sqlGeneratorFactory = sqlGeneratorFactory;
            _modelBuilder        = modelBuilder;
            _transactionHelper   = new Lazy <TransactionHelper>(() => new TransactionHelper(Connection));
        }
Example #10
0
 private void InitSqlExpressionVisitor(ISqlExpressionVisitorFactory sqlGeneratorFactory)
 {
     _sqlExpressionVisitor = new Lazy <ISqlExpressionVisitor>(() => sqlGeneratorFactory.CreateVisitor(Connection));
 }