コード例 #1
0
 public DBConnector(IDbConnection connection, DbConnectorSettings dbConnectorSettings, IMemoryCache cache)
     : this(connection.ConnectionString, dbConnectorSettings, cache)
 {
     ExternalConnection = connection;
     if (ExternalConnection != null)
     {
         DbConnectorSettings.DbType = ResolveDbType(ExternalConnection);
         CacheManager.SetInitialQueries();
     }
 }
コード例 #2
0
 public DBConnector(string strConnectionString, DbConnectorSettings dbConnectorSettings, IMemoryCache cache, IHttpContextAccessor httpContextAccessor)
 {
     ThrowNotificationExceptions = true;
     ForceLocalCache             = false;
     UpdateManyToMany            = true;
     UpdateManyToOne             = true;
     CacheData = true;
     CustomConnectionString = strConnectionString;
     DbConnectorSettings    = dbConnectorSettings;
     CacheManager           = new DbCacheManager(this, cache);
     FileSystem             = new RealFileSystem();
     DynamicImageCreator    = new DynamicImageCreator(FileSystem);
     HttpContext            = httpContextAccessor?.HttpContext;
     WithTransaction        = true;
 }
コード例 #3
0
        public DBConnector(string strConnectionString, DbConnectorSettings dbConnectorSettings, IMemoryCache cache)
        {
            if (!string.IsNullOrWhiteSpace(dbConnectorSettings.ConnectionString))
            {
                ConnectionString = dbConnectorSettings.ConnectionString;
            }

            ThrowNotificationExceptions = true;
            ForceLocalCache             = false;
            UpdateManyToMany            = true;
            UpdateManyToOne             = true;
            CacheData = true;
            CustomConnectionString = strConnectionString;
            DbConnectorSettings    = dbConnectorSettings;
            CacheManager           = new DbCacheManager(this, cache);
            FileSystem             = new RealFileSystem();
            DynamicImageCreator    = new DynamicImageCreator(FileSystem);
            WithTransaction        = true;
        }
コード例 #4
0
        public DBConnector(string strConnectionString, DatabaseType dbType = DatabaseType.SqlServer)
        {
            ForceLocalCache             = false;
            CacheData                   = true;
            UpdateManyToMany            = true;
            UpdateManyToOne             = true;
            ThrowNotificationExceptions = true;

            CustomConnectionString = strConnectionString;
            DbConnectorSettings    = new DbConnectorSettings(ConfigurationManager.AppSettings)
            {
                ConnectionString = strConnectionString,
                DbType           = dbType
            };

            CacheManager        = new DbCacheManager(this);
            FileSystem          = new RealFileSystem();
            DynamicImageCreator = new DynamicImageCreator(FileSystem);
            WithTransaction     = true;
        }
コード例 #5
0
 public DBConnector(DbConnectorSettings dbConnectorSettings, IMemoryCache cache)
     : this(dbConnectorSettings.ConnectionString, dbConnectorSettings, cache)
 {
 }
コード例 #6
0
 public DBConnector(IDbConnection connection, IDbTransaction transaction, DbConnectorSettings dbConnectorSettings, IMemoryCache cache, IHttpContextAccessor httpContextAccessor)
     : this(connection, dbConnectorSettings, cache, httpContextAccessor)
 {
     ExternalTransaction = transaction;
 }
コード例 #7
0
 public DBConnector(DbConnectorSettings dbConnectorSettings, IMemoryCache cache, IHttpContextAccessor httpContextAccessor)
     : this(dbConnectorSettings.ConnectionString, dbConnectorSettings, cache, httpContextAccessor)
 {
 }
コード例 #8
0
 public DBConnector(IDbConnection connection, IDbTransaction transaction, DbConnectorSettings dbConnectorSettings, IMemoryCache cache)
     : this(connection, dbConnectorSettings, cache)
 {
     ExternalTransaction = transaction;
 }