示例#1
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="config"></param>
        /// <param name="_ParameterPrefix"></param>
        public void Init(IDatabase db)
        {
            var status = DatabaseConfigPool.GetInitStatus(db);

            if (status.HasInitSqlMap == false)
            {
                lock (olock)
                {
                    loader.Load(db);
                    status.HasInitSqlMap = true;
                }
            }
        }
示例#2
0
        public void LoadAllMapper(IDatabase db)
        {
            var status = DatabaseConfigPool.GetInitStatus(db);

            if (status.HasLoadAllClassMap == false)
            {
                lock (olock)
                {
                    //初次加载所有映射并预热缓存
                    db.LoadAllMap(db.Config.MappingAssemblies, db.Config.LoadMapperMode);
                    //待定 修改所有table的前缀,根据配置的GlobalTablePrefix  20180716

                    status.HasLoadAllClassMap = true;
                }
            }
        }