Beispiel #1
0
        /// <summary>
        ///     创建对应BL,如果缓存可用,则使用缓存
        /// </summary>
        public static IBL Create <IBL>(WeatherLib.DAL.UnitOfWork uw = null) where IBL : class
        {
            return(null == uw?CreateNew <IBL>() : CreateNew <IBL>(uw));

            // 现在还没遇到性能瓶颈,无需使用以下方法

            /*var service = CurrentService;
             *  if (service  == null) {
             * return null == uw ? CreateNew<IBL>() : CreateNew<IBL>(uw);
             *  }
             *  if (null == uw) {
             * return service.BL<IBL>() as IBL;
             * }
             * var cur_uw = service.UnitOfWork;
             *  if (uw == cur_uw) {
             * return service.BL<IBL>() as IBL;
             * } else {
             *    return CreateNew<IBL>(uw);
             *  }*/
        }
 public BASE_ROLERepository(WeatherLib.DAL.UnitOfWork unitOfWork) : base(unitOfWork)
 {
     this.UnitOfWork = unitOfWork;
 }
 public JD_ProductRepository(WeatherLib.DAL.UnitOfWork unitOfWork) : base(unitOfWork)
 {
     this.UnitOfWork = unitOfWork;
 }
 public BaseUserRepository(WeatherLib.DAL.UnitOfWork unitOfWork) : base(unitOfWork)
 {
     this.UnitOfWork = unitOfWork;
 }
Beispiel #5
0
 public WeatherDailyForecastRepository(WeatherLib.DAL.UnitOfWork unitOfWork) : base(unitOfWork)
 {
     this.UnitOfWork = unitOfWork;
 }
Beispiel #6
0
 public WeatherCityRepository(WeatherLib.DAL.UnitOfWork unitOfWork) : base(unitOfWork)
 {
     this.UnitOfWork = unitOfWork;
 }