public void TestSetup() { databaseConnection = new DatabaseConnectionMonitor(Properties.Settings.Default.TestDatabase); List <AgentDataModel> agents = databaseConnection.GetAgentsFromDatabase(); if (agents.Count == 0) { databaseConnection.AddAgentToDatabase(agent, false, false); } }
public SNMPController(string connectionString) { _databaseConnection = new DatabaseConnectionMonitor(connectionString); }
public static void SaveExceptionToDB(string category, Exception exc) { DatabaseConnectionMonitor connectionManager = new DatabaseConnectionMonitor(Properties.Settings.Default.ProdDatabase); connectionManager.AddEventToDatabase(exc.GetType().ToString(), category, DateTime.Now, exc.HResult.ToString(), exc.Message, exc.StackTrace); }