/// <summary> /// Saves changes to session, Disposes DB /// </summary> /// <param name="disposing"></param> protected override void Dispose(bool disposing) { if (disposing) { //Save auth if (_appAuthorization != null && _appAuthorization.IsAuthenticated) { Authorization.SetResponse(); } //Save session if (_appSession != null) { Session.SetResponse(); } //Dispose db if (_appDatabase != null) { _appDatabase.Dispose(); } } base.Dispose(disposing); }
static void restarter() { Log.Info("RESTARTING SERVER"); Log.Fine("Some values have been changed that require a soft restart."); ClearThreads(); Database.Dispose(); Setup(); Log.Info("RESTART SUCCESSFUL"); }
private static AppDatabase OpenDatabase() { lock (_lock) { if (null == mDatabase) { mDatabase = new AppDatabase(DatabaseConnectionString); } else if (!mDatabase.IsConnected || mDatabase.ConnectionString != DatabaseConnectionString) { mDatabase.Dispose(); mDatabase = new AppDatabase(DatabaseConnectionString); } } return(mDatabase); }
public void Dispose() { db.Dispose(); }
public void Dispose() => _database.Dispose();
public void Dispose() { _context.Dispose(); }
public void Dispose() { AppDatabase.Dispose(); }