コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }