public DBConnector(IDbConnection connection, DbConnectorSettings dbConnectorSettings, IMemoryCache cache) : this(connection.ConnectionString, dbConnectorSettings, cache) { ExternalConnection = connection; if (ExternalConnection != null) { DbConnectorSettings.DbType = ResolveDbType(ExternalConnection); CacheManager.SetInitialQueries(); } }
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; }
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; }
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; }
public DBConnector(DbConnectorSettings dbConnectorSettings, IMemoryCache cache) : this(dbConnectorSettings.ConnectionString, dbConnectorSettings, cache) { }
public DBConnector(IDbConnection connection, IDbTransaction transaction, DbConnectorSettings dbConnectorSettings, IMemoryCache cache, IHttpContextAccessor httpContextAccessor) : this(connection, dbConnectorSettings, cache, httpContextAccessor) { ExternalTransaction = transaction; }
public DBConnector(DbConnectorSettings dbConnectorSettings, IMemoryCache cache, IHttpContextAccessor httpContextAccessor) : this(dbConnectorSettings.ConnectionString, dbConnectorSettings, cache, httpContextAccessor) { }
public DBConnector(IDbConnection connection, IDbTransaction transaction, DbConnectorSettings dbConnectorSettings, IMemoryCache cache) : this(connection, dbConnectorSettings, cache) { ExternalTransaction = transaction; }