/// <summary>
        /// get DB connection by service name
        /// </summary>
        /// <param name="service"></param>
        /// <returns></returns>
        public static string DBConnectionStringGet(CommonEnum.ServiceName service)
        {
            string dbStr = ConfigSettingHelper.DBConfigKeyGet(service);

            if (string.IsNullOrEmpty(dbStr))
            {
                Assert.Fail(string.Format("no mapping ConnectionString in app.config for {0}!", service.ToString()));
            }
            return(ConfigurationManager.ConnectionStrings[dbStr].ConnectionString);
        }
Beispiel #2
0
 public ConfigurationDBHelper(CommonEnum.ServiceName service, ConfigSettingType configType)
 {
     this.ConnectionString  = CarSCSCommonHelper.DBConnectionStringGet(service);
     this.ConfigurationType = configType;
 }
 public ErrorMapHelper(CommonEnum.ServiceName service)
 {
     this.ConnectionString = CarSCSCommonHelper.DBConnectionStringGet(service);
 }