Beispiel #1
0
 public PreparedCommand_Test()
 {
     _smartSqlOptions = new SmartSqlOptions();
     _smartSqlOptions.Setup();
     _sessionStore    = _smartSqlOptions.DbSessionStore;
     _preparedCommand = new PreparedCommand(LoggerFactory.CreateLogger <PreparedCommand>(), _smartSqlOptions.SmartSqlContext);
 }
Beispiel #2
0
 public CommandExecuter_Test()
 {
     _smartSqlOptions = new SmartSqlOptions();
     _smartSqlOptions.Setup();
     _sessionStore    = _smartSqlOptions.DbSessionStore;
     _commandExecuter = new CommandExecuter(LoggerFactory.CreateLogger <CommandExecuter>(), _smartSqlOptions.PreparedCommand);
 }
Beispiel #3
0
 public DataSourceFilter(ILogger <DataSourceFilter> logger
                         , IDbConnectionSessionStore dbSessionStore
                         , SmartSqlContext smartSqlContext)
 {
     _logger          = logger;
     _dbSessionStore  = dbSessionStore;
     _smartSqlContext = smartSqlContext;
 }
 public EmitDataReaderDeserializer_Test()
 {
     _deserializerFactory = new EmitDataReaderDeserializerFactory();
     _smartSqlOptions     = new SmartSqlOptions {
         DataReaderDeserializerFactory = _deserializerFactory
     };
     _smartSqlOptions.Setup();
     _sessionStore    = _smartSqlOptions.DbSessionStore;
     _commandExecuter = new CommandExecuter(LoggerFactory.CreateLogger <CommandExecuter>(), _smartSqlOptions.PreparedCommand);
 }
Beispiel #5
0
 public CacheManager(
     ILogger <CacheManager> logger
     , SmartSqlContext smartSqlContext
     , IDbConnectionSessionStore dbSessionStore)
 {
     _logger          = logger;
     _smartSqlContext = smartSqlContext;
     _dbSessionStore  = dbSessionStore;
     InitCacheMappedLastFlushTime();
     _timer = new System.Threading.Timer(Run, null, _defaultDueTime, _defaultPeriodTime);
 }
Beispiel #6
0
        public CommandExecuter_Test()
        {
            _sessionStore = new DbConnectionSessionStore(LoggerFactory, DbProviderFactory);
            var _configLoader = new LocalFileConfigLoader(SqlMapConfigFilePath, LoggerFactory);
            var config        = _configLoader.Load();

            _smartSqlContext = new SmartSqlContext(LoggerFactory.CreateLogger <SmartSqlContext>(), config);

            _sqlBuilder      = new SqlBuilder(LoggerFactory.CreateLogger <SqlBuilder>(), _smartSqlContext, _configLoader);
            _preparedCommand = new PreparedCommand(LoggerFactory.CreateLogger <PreparedCommand>(), _smartSqlContext);
            _commandExecuter = new CommandExecuter(LoggerFactory.CreateLogger <CommandExecuter>(), _preparedCommand);
        }
Beispiel #7
0
 public SmartSqlMapper(
     String sqlMapConfigFilePath
     , IDbConnectionSessionStore sessionStore
     , IDataSourceManager dataSourceManager
     , ICacheManager cacheManager
     , ISqlBuilder sqlBuilder
     , IConfigLoader configLoader
     )
 {
     configLoader.Load(sqlMapConfigFilePath, this);
     DbProviderFactory = SqlMapConfig.Database.DbProvider.DbProviderFactory;
     SessionStore      = sessionStore;
     SqlBuilder        = sqlBuilder;
     DataSourceManager = dataSourceManager;
     CacheManager      = cacheManager;
     _sqlRuner         = new SqlRuner(SqlBuilder, this);
 }
Beispiel #8
0
 public SmartSqlMapper(
     ILoggerFactory loggerFactory,
     String sqlMapConfigFilePath
     , IDbConnectionSessionStore sessionStore
     , IDataSourceManager dataSourceManager
     , ICacheManager cacheManager
     , ISqlBuilder sqlBuilder
     , IConfigLoader configLoader
     )
 {
     _loggerFactory = loggerFactory;
     _logger        = loggerFactory.CreateLogger <SmartSqlMapper>();
     configLoader.Load(sqlMapConfigFilePath, this);
     DbProviderFactory           = SqlMapConfig.Database.DbProvider.DbProviderFactory;
     SessionStore                = sessionStore;
     SqlBuilder                  = sqlBuilder;
     DataSourceManager           = dataSourceManager;
     CacheManager                = cacheManager;
     CacheManager.SmartSqlMapper = this;
     _sqlRuner = new SqlRuner(loggerFactory, SqlBuilder, this);
 }
 public DbConnectionSessionStore_Test()
 {
     _sessionStore = new DbConnectionSessionStore(LoggerFactory, DbProviderFactory);
 }
 public DbConnectionSession_Test()
 {
     _sessionStore      = new DbConnectionSessionStore(LoggerFactory, DbProviderFactory);
     _connectionSession = _sessionStore.GetOrAddDbSession(DataSource);
 }