Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
 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");
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public void Dispose()
 {
     db.Dispose();
 }
Exemplo n.º 5
0
 public void Dispose() => _database.Dispose();
 public void Dispose()
 {
     _context.Dispose();
 }
Exemplo n.º 7
0
 public void Dispose()
 {
     AppDatabase.Dispose();
 }