Exemple #1
0
 /// <summary>
 /// 基本业务方法封装
 /// </summary>
 public ProviderOrigin()
 {
     dbLocation = new DBLocation()
     {
         ManageType = GetType()
     };
 }
Exemple #2
0
 /// <summary>
 /// 数据访问上下文
 /// </summary>
 /// <param name="dbHelper"></param>
 /// <param name="dbLocation"></param>
 public DbContext(CoreHelper.DBHelper dbHelper, DBLocation dbLocation)
 {
     DBHelper   = dbHelper;
     DBLocation = dbLocation;
     //todo 按数据库类型类型判断
     DataBaseArchitecture = dbHelper.CurrentDBType == CoreHelper.DBType.MongoDB ? DataBaseArchitecture.NotRelation : CRL.DataBaseArchitecture.Relation;
 }
 static DBAccessBuild GetDBAccessBuild(DBLocation location)
 {
     foreach (var m in instance.DbAccessCreaterRegister)
     {
         var act = m(location);
         if (act != null)
         {
             return(act);
         }
     }
     throw new Exception($"未找到对应的数据访问实现");
 }
Exemple #4
0
        internal static DBAccessBuild GetDBAccessBuild(DBLocation location)
        {
            var configBuilder = SettingConfigBuilder.current;

            foreach (var m in configBuilder.DbAccessCreaterRegister)
            {
                var act = m(location);
                if (act != null)
                {
                    return(act);
                }
            }
            throw new CRLException($"未找到对应的数据访问实现");
        }
Exemple #5
0
 /// <summary>
 /// 数据访问上下文
 /// </summary>
 /// <param name="dbHelper"></param>
 /// <param name="dbLocation"></param>
 public DbContext(CoreHelper.DBHelper dbHelper, DBLocation dbLocation)
 {
     DBHelper = dbHelper;
     DBLocation = dbLocation;
 }
Exemple #6
0
 /// <summary>
 /// 数据访问上下文
 /// </summary>
 /// <param name="dbHelper"></param>
 /// <param name="dbLocation"></param>
 public DbContext(CoreHelper.DBHelper dbHelper, DBLocation dbLocation)
 {
     DBHelper   = dbHelper;
     DBLocation = dbLocation;
 }
        internal static DBHelper GetDBHelper(DBLocation location)
        {
            var dBAccessBuild = GetDBAccessBuild(location);

            return(GetDBHelper(dBAccessBuild));
        }