public SettingRepository() { string host = ConfigurationManager.AppSettings["DatabaseHost"]; string user = ConfigurationManager.AppSettings["DatabaseUser"]; string name = ConfigurationManager.AppSettings["DatabaseName"]; string password = ConfigurationManager.AppSettings["DatabasePassword"]; string connectionString = $"data source={host};Initial Catalog={name};User ID={user};Password={Crypto.Decrypt(password)};"; _dbExecutor = new DbExecutor(connectionString); }
public MeasurementToolAccreditationRepository() { string host = ConfigurationManager.AppSettings["DatabaseHost"]; string user = ConfigurationManager.AppSettings["DatabaseUser"]; string name = ConfigurationManager.AppSettings["DatabaseName"]; string password = ConfigurationManager.AppSettings["DatabasePassword"]; string connectionString = $"data source={host};Initial Catalog={name};User ID={user};Password={Crypto.Decrypt(password)};"; _dbExecutor = new DbExecutor(connectionString); _context = new EntityFramework.EPONSContext(connectionString); }