示例#1
0
 /// <summary>
 /// 基本业务方法封装
 /// </summary>
 public ProviderOrigin()
 {
     dbLocation = new DBLocation()
     {
         ManageType = GetType()
     };
 }
示例#2
0
文件: DbContext.cs 项目: zmk523/CRL3
 /// <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($"未找到对应的数据访问实现");
 }
示例#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($"未找到对应的数据访问实现");
        }
示例#5
0
文件: DbContext.cs 项目: yhhno/CRL3
 /// <summary>
 /// 数据访问上下文
 /// </summary>
 /// <param name="dbHelper"></param>
 /// <param name="dbLocation"></param>
 public DbContext(CoreHelper.DBHelper dbHelper, DBLocation dbLocation)
 {
     DBHelper = dbHelper;
     DBLocation = dbLocation;
 }
示例#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));
        }