Esempio n. 1
0
 public AuthenHelper(ISessionHelper sessionHelper, ICryptoHelper cryptoHelper, IServiceHelper serviceHelper, ICacheHelper cacheHelper)
 {
     _httpContext = HttpContext.Current;
     _sessionHelper = sessionHelper;
     _cryptoHelper = cryptoHelper;
     _serviceHelper = serviceHelper;
     _cacheHelper = cacheHelper;
 }
 public void Setup()
 {
     _companyId = 800;
     _title = "Test";
     _documentTypeId = 5;
     _documentTypeService = new Mock<IDocHandlerDocumentTypeService>();
     _subDocumentTypeService = new Mock<IDocumentSubTypeService>();
     _clientDocumentService = new Mock<IClientDocumentService>();
     _clientDocumentTypeService = new Mock<BusinessSafe.WebSite.DocumentTypeService.IDocumentTypeService>();
     _cacheHelper = new FakeCacheHelper();
     _siteService = new Mock<ISiteService>();
     _siteService.Setup(x => x.GetAll(It.IsAny<long>())).Returns(new List<SiteDto>());
 }
Esempio n. 3
0
 public MyCacher()
 {
     if (getCacheType() == CacheType.Disk) {
         this.cacher = new DiskCache();
     }
     else if (getCacheType() == CacheType.InMemory) {
         this.cacher = new InMemoryCache();
     }
     else if (getCacheType() == CacheType.Memechaed) {
         this.cacher = new MemcachedCache();
     }
     else
         this.cacher = new NonCache();
 }
 public AddUsersController(
     IAddUsersViewModelFactory addUsersViewModelFactory, 
     IUserService userService, 
     IEmployeeService employeeService,
     INewRegistrationRequestService newRegistrationRequestService, 
     ICacheHelper cacheHelper,
     IBus bus)
 {
     _addUsersViewModelFactory = addUsersViewModelFactory;
     _userService = userService;
     _employeeService = employeeService;
     _newRegistrationRequestService = newRegistrationRequestService;
     _cacheHelper = cacheHelper;
     _bus = bus;
 }
        public static Boolean IsExpried( String key, ICacheHelper cacher )
        {
            if (key.StartsWith( "/Forum" )) {
                ForumExpirationChecker fcc = new ForumExpirationChecker( cacher );
                return fcc.IsExpried( key );
            }
            else if (key.StartsWith( "/Content" )) {
                ContentExpirationChecker fcc = new ContentExpirationChecker( cacher );
                return fcc.IsExpried( key );
            }

            else {

                return false;
            }
        }
Esempio n. 6
0
 public ProfileRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory)
 {
     _cacheHelper      = cacheHelper;
     _sqlObjectFactory = sqlObjectFactory;
 }
 public LoadImageService(IExternalImageServiceClient client, ICacheHelper cacheHelper, IOptions <IFictionConfiguration> configuration)
 {
     _client        = client;
     _cacheHelper   = cacheHelper;
     _configuration = configuration.Value;
 }
 public ContentExpirationChecker(ICacheHelper cacher)
 {
     this.cacher = cacher;
 }
Esempio n. 9
0
 public EmailUtils()
 {
     _emailHelper = ObjectFactory.GetInstance<IEmailHelper>();
     _cacheHelper = ObjectFactory.GetInstance<ICacheHelper>();
 }
Esempio n. 10
0
 public void Publish <CacheType>(string msg) where CacheType : RedisCacheHelper, new()
 {
     cache = GetCacheHelper <CacheType>();
     cache.Publish(msg);
 }
Esempio n. 11
0
 public RoleService(IRoleRepository repository, IBeUserRepository repositoryBeUser,ICacheHelper cacheHelper)
 {
     _cacheHelper = cacheHelper;
     _repository = repository;
     _repositoryBeUser = repositoryBeUser;
 }
Esempio n. 12
0
		public ForumRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory)
		{
			_cacheHelper = cacheHelper;
			_sqlObjectFactory = sqlObjectFactory;
		}
 /// <summary>
 /// 取得或依據委派初始化快取內容,存活時間預設 60秒
 /// </summary>
 /// <typeparam name="T">快取物件型別</typeparam>
 /// <param name="cacheHelper">CacheHelper</param>
 /// <param name="key">快取鍵值</param>
 /// <param name="acquire">初始化的快取物件委派</param>
 /// <returns>快取的物件</returns>
 public static T Get <T>(this ICacheHelper cacheHelper, string key, Func <T> acquire)
 {
     return(Get(cacheHelper, key, 60, acquire));
 }
Esempio n. 14
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="IFileCenterServices"></param>
 /// <param name="userRoleServices"></param>
 /// <param name="roleServices"></param>
 public ClientStageDataController(IProductServices productServices, IAdvertisementServices advertisementServices, ICacheHelper IcacheHelper, IWebHostEnvironment env)
 {
     _productServices       = productServices;
     _advertisementServices = advertisementServices;
     _cacheHelper           = IcacheHelper;
     _env = env;
 }
 public ShoppingCartController(ICacheHelper cacheHelper, ISalesContext context)
 {
     Context = context;
       CacheHelper = cacheHelper;
 }
Esempio n. 16
0
 /// <summary>
 /// 保存缓存并设置绝对过期时间
 /// </summary>
 /// <typeparam name="CacheType">缓存类型</typeparam>
 /// <param name="key">键名</param>
 /// <param name="value">值</param>
 /// <param name="expiressAbsoulte">绝对过期时间</param>
 public void Save <CacheType>(string key, object value, DateTimeOffset expiressAbsoulte) where CacheType : ICacheHelper, new()
 {
     cache = GetCacheHelper <CacheType>();
     cache.SetCache(key, value, expiressAbsoulte);
 }
Esempio n. 17
0
 /// <summary>
 /// 保存缓存
 /// </summary>
 /// <typeparam name="CacheType">缓存类型</typeparam>
 /// <param name="key">键名</param>
 /// <param name="value">值</param>
 public void Save <CacheType>(string key, object value) where CacheType : ICacheHelper, new()
 {
     cache = GetCacheHelper <CacheType>();
     cache.SetCache(key, value);
 }
Esempio n. 18
0
 /// <summary>
 /// 判断缓存是否存在
 /// </summary>
 /// <typeparam name="CacheType">缓存类型</typeparam>
 /// <param name="key">键名</param>
 /// <returns></returns>
 public bool Exists <CacheType>(string key)
     where CacheType : ICacheHelper, new()
 {
     cache = GetCacheHelper <CacheType>();
     return(cache.Exists(key));
 }
Esempio n. 19
0
 private EntityFactory()
 {
     // intended blank
     _cache = CacheSettingsHelper <Type, object> .Current;
 }
Esempio n. 20
0
 public LoginService(ICacheHelper cacheHelper)
 {
     _cacheHelper = cacheHelper;
     logError     = LogManager.GetLogger("ERROR");
     logInfo      = LogManager.GetLogger("INFO");
 }
Esempio n. 21
0
 public CachedPermissionScopeRepository(IDependencyResolver dependencyResolver, ICache cache, ICacheHelper cacheHelper, SecurityConfiguration configuration) : base(dependencyResolver, cache, cacheHelper)
 {
     _configuration = configuration;
 }
Esempio n. 22
0
 public TransformPackageConsumer(IAssetManager assetManager, ICacheHelper cacheHelper, IBus bus)
 {
     this.assetManager = assetManager;
     this.cacheHelper  = cacheHelper;
     this.bus          = bus;
 }
Esempio n. 23
0
 public SessionHelper(ICacheHelper cacheHelper)
 {
     _cacheHelper = cacheHelper;
 }
Esempio n. 24
0
 public BeUserService(IBeUserRepository repository, IRequestPasswordRepository requestPasswordRepository, ICacheHelper cacheHelper)
 {
     _cacheHelper = cacheHelper;
     _repository = repository;
     _requestPasswordRepository = requestPasswordRepository;
 }
 public PrivateMessageRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory)
 {
     _cacheHelper      = cacheHelper;
     _sqlObjectFactory = sqlObjectFactory;
 }
Esempio n. 26
0
 public ProductService(IProductRepository repository, ICacheHelper cacheHelper)
 {
     _repository = repository;
     _cacheHelper = cacheHelper;
 }
Esempio n. 27
0
 public TestController(IUserRepository userRepo, ICacheHelper cacheHelper)
 {
     this.UserRepo    = userRepo;
     this.CacheHelper = cacheHelper;
 }
Esempio n. 28
0
 public SimCaptchaService Set(ICacheHelper cacheHelper)
 {
     this._cacheHelper = cacheHelper;
     return(this);
 }
Esempio n. 29
0
 public AncestrySearch(ICacheHelper cacheHelper, ILogger logger)
 {
     _cacheHelper = cacheHelper;
     _logger      = logger;
 }
Esempio n. 30
0
 public void SetImplementation(ICacheHelper instance)
 {
     implementation = instance;
 }
Esempio n. 31
0
 public static void AddUpdater( String typeName, ICacheHelper obj )
 {
     dic.Add( typeName, obj );
 }
Esempio n. 32
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="works"></param>
 /// <param name="currentUser"></param>
 /// <param name="comBll"></param>
 /// <param name="cacheHelper"></param>
 /// <param name="sugarDbSeed"></param>
 /// <param name="logHelper"></param>
 public PermissionController(IRepository works, CurrentUser currentUser, ComBll comBll, ICacheHelper cacheHelper,
                             SugarDbSeed sugarDbSeed, ILogHelper <PermissionController> logHelper)
 {
     this.works       = works;
     this.currentUser = currentUser;
     this.comBll      = comBll;
     this.cacheHelper = cacheHelper;
     this.sugarDbSeed = sugarDbSeed;
     this.logHelper   = logHelper;
 }
 /// <summary>
 /// 构造方法
 /// </summary>
 /// <param name="logHelper"></param>
 /// <param name="repo"></param>
 /// <param name="cache"></param>
 /// <param name="currentUser"></param>
 public LoginController(ILogHelper <LoginController> logHelper, CurrentUser currentUser, IRepository repo, ICacheHelper cache)
 {
     this.logHelper   = logHelper;
     this.currentUser = currentUser;
     this.repo        = repo;
     this.cache       = cache;
 }
Esempio n. 34
0
 public QueueDataModel(ICacheHelper cacheHelper)
 {
     this._cacheHelper = cacheHelper;
 }
Esempio n. 35
0
 public DriverLicenseTypeService(IDriverLicenseTypeRepository typeRepository, IAgentRepository agentRepository, ICacheHelper cacheHelper)
     : base(agentRepository, cacheHelper)
 {
     _typeRepository  = typeRepository;
     _agentRepository = agentRepository;
     _cacheHelper     = cacheHelper;
 }
 public ContentExpirationChecker( ICacheHelper cacher )
 {
     this.cacher = cacher;
 }
 /// <param name="bundles">
 /// The bundle collection that the bundles will be added to.
 ///
 /// Outside tests, this would always be BundleTable.Bundles
 /// </param>
 /// <param name="cacheHelper">
 /// Cachehelper to use.
 /// </param>
 public DynamicBundlesBuilder(IDynamicBundleCollection bundles, ICacheHelper cacheHelper, BundleFactories bundleFactories)
 {
     _bundles         = bundles;
     _cacheHelper     = cacheHelper;
     _bundleFactories = bundleFactories;
 }
Esempio n. 38
0
 /// <summary>
 /// 区域 逻辑层
 /// </summary>
 /// <param name="Logger"></param>
 /// <param name="ICacheHelper"></param>
 /// <param name="IRegionRepository"></param>
 public RegionManager(ILogger <CouponManager> Logger, ICacheHelper ICacheHelper, IRegionRepository IRegionRepository)
 {
     _logger           = Logger;
     _ICacheHelper     = ICacheHelper;
     _RegionRepository = IRegionRepository;
 }
Esempio n. 39
0
        private IList <IBaseCacheKey> Refiller <TElement>(
            FreshnessRequest freshness,
            IBaseCacheKey collectionKey,
            Func <FreshnessRequest, IList <TElement> > filler,
            Func <IBaseCacheKey, TElement, IBaseCacheKey>[] keyProjections)
            where TElement : class
        {
            IList <IBaseCacheKey> keys = null;
            var parameters             = BuildParameters(collectionKey, filler);
            var result = parameters.Fill(freshness);

            if (result.Item2 || result.Item1 == null)
            {
                return(keys);
            }

            var list = result.Item1;
            // clear ALL cache if null return from backing store used to be here...

            // do NOT store in cache yet, this is not the correct answer-set type yet.
            var elementPolicies = new ICachePolicy[keyProjections.Length];

            keys = new List <IBaseCacheKey>(list.Count);

            foreach (var element in list)
            {
                var collectionPolicy = collectionKey.Policy;
                int whichProjection  = 0;

                foreach (var projection in keyProjections)
                {
                    var elementKey = projection(collectionKey, element);
                    if (elementKey == null) // ignore null key projections
                    {
                        continue;
                    }

                    var elementPolicy = elementPolicies[whichProjection];

                    if (elementPolicy == null)
                    {
                        elementPolicy             = elementKey.Policy.Clone();
                        elementPolicy.RefillCount = 0;  // we never refill from underneath

                        if (elementPolicy.AbsoluteSeconds > 0)
                        {
                            if (elementPolicy.AbsoluteSeconds <= collectionPolicy.AbsoluteSeconds)
                            {
                                elementPolicy.AbsoluteSeconds = collectionPolicy.AbsoluteSeconds + 10; // to help serialized expiriation!
                            }
                        }
                        else if (elementPolicy.SlidingSeconds > 0)
                        {
                            if (elementPolicy.SlidingSeconds <= collectionPolicy.SlidingSeconds)
                            {
                                elementPolicy.SlidingSeconds = collectionPolicy.SlidingSeconds + 10; // to help serialized expiriation!
                            }
                        }

                        elementPolicies[whichProjection] = elementPolicy;
                    }

                    // TODO still not right, Marc
                    InternalPut(BuildParameters(
                                    elementKey.Key
                                    , elementPolicy
                                    , ICacheHelper.Once(element))
                                , element);

                    if (whichProjection++ == 0)
                    {
                        keys.Add(elementKey);
                    }
                }
            }

            return(keys);
        }
Esempio n. 40
0
 public RequestPasswordService(IRequestPasswordRepository repository, ICustomerRepository userRepository)
 {
     _repository = repository;
     _userRepository = userRepository;
     _cacheHelper = ObjectFactory.GetInstance<ICacheHelper>();
 }
Esempio n. 41
0
 public ArticeService(IArticeRepository repository, ICacheHelper cacheHelper)
 {
     _repository = repository;
     _cacheHelper = cacheHelper;
 }
 public ReferenceDocumentsLibraryController(IDocumentLibraryViewModelFactory viewModelFactory, IDocumentSubTypeService documentSubTypeService, ICacheHelper cacheHelper)
 {
     _viewModelFactory = viewModelFactory;
     _documentSubTypeService = documentSubTypeService;
     _cacheHelper = cacheHelper;
 }
Esempio n. 43
0
 public DependencyResolver(ICacheHelper cacheHelper)
 {
     _cacheHelper = cacheHelper;
 }
		public UserSessionRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory)
		{
			_cacheHelper = cacheHelper;
			_sqlObjectFactory = sqlObjectFactory;
		}
 public ForumExpirationChecker( ICacheHelper cacher )
 {
     this.cacher = cacher;
 }
Esempio n. 46
0
 public FileDataModel(ICacheHelper cacheHelper, IApplicationConfig applicationConfig)
 {
     this._cacheHelper       = cacheHelper;
     this._applicationConfig = applicationConfig;
 }
Esempio n. 47
0
 public HomeController(ICacheHelper cacheHelper)
 {
     CacheHelper = cacheHelper;
 }
 /// <param name="bundles">
 /// The bundle collection that the bundles will be added to.
 /// 
 /// Outside tests, this would always be BundleTable.Bundles
 /// </param>
 /// <param name="cacheHelper">
 /// Cachehelper to use.
 /// </param>
 public DynamicBundlesBuilder(IDynamicBundleCollection bundles, ICacheHelper cacheHelper, BundleFactories bundleFactories)
 {
     _bundles = bundles;
     _cacheHelper = cacheHelper;
     _bundleFactories = bundleFactories;
 }
Esempio n. 49
0
 public UserSessionRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory)
 {
     _cacheHelper      = cacheHelper;
     _sqlObjectFactory = sqlObjectFactory;
 }
 public CustomPrincipalFactory(IUserService userService, IClientService clientService, ICacheHelper cacheHelper)
 {
     _userService = userService;
     _cacheHelper = cacheHelper;
     _clientService = clientService;
 }
 public DigitalisierungsAuftragErledigtConsumer(IBus bus,
                                                IRequestClient <FindArchiveRecordRequest> findArchiveRecordClient,
                                                IRequestClient <PrepareAssetRequest> prepareClient,
                                                IOrderDataAccess orderDataAccess, ICacheHelper cacheHelper)
 {
     this.bus = bus;
     this.findArchiveRecordClient = findArchiveRecordClient;
     this.prepareClient           = prepareClient;
     this.orderDataAccess         = orderDataAccess;
     this.cacheHelper             = cacheHelper;
 }
		public PrivateMessageRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory)
		{
			_cacheHelper = cacheHelper;
			_sqlObjectFactory = sqlObjectFactory;
		}
Esempio n. 53
0
 public LedgerSheet(LedgerContext ledger,
                    ICacheHelper cache)
 {
     _ledger = ledger;
     _cache  = cache;
 }
Esempio n. 54
0
        public ContactUsService(ISystemEmailTemplateRepository repository)
        {
            _repository = repository;

            _cacheHelper = ObjectFactory.GetInstance<ICacheHelper>();
        }
Esempio n. 55
0
 public TopicRepository(ISqlObjectFactory sqlObjectFactory, ICacheHelper cache)
 {
     _sqlObjectFactory = sqlObjectFactory;
     _cache            = cache;
 }