/// <summary>
        /// Have the driver cleanup after itself
        /// </summary>
        protected override void DriverDispose()
        {
            if (this.driver != null)
            {
                this.driver.Dispose();
            }

            this.driver = null;
        }
        /// <summary>
        /// Get the database driver
        /// </summary>
        /// <returns>The database driver</returns>
        public DatabaseDriver GetDatabaseDriver()
        {
            if (this.driver == null)
            {
                if (LoggingConfig.GetLoggingEnabledSetting() == LoggingEnabled.NO)
                {
                    this.Log.LogMessage(MessageType.INFORMATION, "Getting database driver");
                    this.driver = new DatabaseDriver(GetBase() as IDbConnection);
                }
                else
                {
                    this.Log.LogMessage(MessageType.INFORMATION, "Getting event firing database driver");
                    this.driver = new EventFiringDatabaseDriver(GetBase() as IDbConnection);
                    this.MapEvents(this.driver as EventFiringDatabaseDriver);
                }
            }

            return(this.driver);
        }
Beispiel #3
0
 /// <summary>
 /// Override the database connection driver
 /// </summary>
 /// <param name="driver">New database connection driver</param>
 public void OverrideDatabaseDriver(DatabaseDriver driver)
 {
     this.DatabaseManager.OverwriteDriver(driver);
 }
 /// <summary>
 /// Override the email driver - respects lazy loading
 /// </summary>
 /// <param name="overrideDriver">Function for getting new database connection</param>
 public void OverrideDriver(Func <IDbConnection> overrideDriver)
 {
     this.driver = null;
     this.OverrideDriverGet(overrideDriver);
 }
 /// <summary>
 /// Override the database driver
 /// </summary>
 /// <param name="newDriver">The new driver</param>
 public void OverrideDriver(DatabaseDriver newDriver)
 {
     this.driver     = newDriver;
     this.BaseDriver = newDriver.Connection;
 }
Beispiel #6
0
 /// <summary>
 /// Override the database driver
 /// </summary>
 /// <param name="newDriver">The new driver</param>
 public void OverwriteDriver(DatabaseDriver newDriver)
 {
     this.driver = newDriver;
 }
Beispiel #7
0
 public void OverwriteDriver(DatabaseDriver newDriver)
 {
     this.OverrideDriver(newDriver);
 }