Exemple #1
0
        public void ReadCofingEntity()
        {
            try
            {
                KdtDriver val = JsonConfigurationHelper.Instance.GetAppSettings <KdtDriver>("main");

                DbDriverMember sqldb = JsonConfigurationHelper.Instance.GetAppSettings <DbDriverMember>("sqlserverdb");

                Assert.IsTrue(val != null && !string.IsNullOrEmpty(val.prefix));
            }
            catch
            {
                Assert.IsTrue(false);
            }
        }
Exemple #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="_driver"></param>
        public AdapterSql(DbDriverMember _driver)
        {
            this._DriverType = _driver.Driver.Convert(DriverType.sqlserver);
            if (_driver.Prefix.IsNullOrEmpty())
            {
                switch (_DriverType)
                {
                case DriverType.oracle: Prefix = ":"; break;

                default: Prefix = "@"; break;
                }
            }
            else
            {
                Prefix = _driver.Prefix;
            }
        }
Exemple #3
0
 /// <summary>
 /// 设置适配器
 /// </summary>
 /// <param name="_driver"></param>
 public void SetAdapter(DbDriverMember _driver)
 {
     Adapter = new AdapterSql(_driver);
 }