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>()); }
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; } }
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; }
public EmailUtils() { _emailHelper = ObjectFactory.GetInstance<IEmailHelper>(); _cacheHelper = ObjectFactory.GetInstance<ICacheHelper>(); }
public void Publish <CacheType>(string msg) where CacheType : RedisCacheHelper, new() { cache = GetCacheHelper <CacheType>(); cache.Publish(msg); }
public RoleService(IRoleRepository repository, IBeUserRepository repositoryBeUser,ICacheHelper cacheHelper) { _cacheHelper = cacheHelper; _repository = repository; _repositoryBeUser = repositoryBeUser; }
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)); }
/// <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; }
/// <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); }
/// <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); }
/// <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)); }
private EntityFactory() { // intended blank _cache = CacheSettingsHelper <Type, object> .Current; }
public LoginService(ICacheHelper cacheHelper) { _cacheHelper = cacheHelper; logError = LogManager.GetLogger("ERROR"); logInfo = LogManager.GetLogger("INFO"); }
public CachedPermissionScopeRepository(IDependencyResolver dependencyResolver, ICache cache, ICacheHelper cacheHelper, SecurityConfiguration configuration) : base(dependencyResolver, cache, cacheHelper) { _configuration = configuration; }
public TransformPackageConsumer(IAssetManager assetManager, ICacheHelper cacheHelper, IBus bus) { this.assetManager = assetManager; this.cacheHelper = cacheHelper; this.bus = bus; }
public SessionHelper(ICacheHelper cacheHelper) { _cacheHelper = cacheHelper; }
public BeUserService(IBeUserRepository repository, IRequestPasswordRepository requestPasswordRepository, ICacheHelper cacheHelper) { _cacheHelper = cacheHelper; _repository = repository; _requestPasswordRepository = requestPasswordRepository; }
public PrivateMessageRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory) { _cacheHelper = cacheHelper; _sqlObjectFactory = sqlObjectFactory; }
public ProductService(IProductRepository repository, ICacheHelper cacheHelper) { _repository = repository; _cacheHelper = cacheHelper; }
public TestController(IUserRepository userRepo, ICacheHelper cacheHelper) { this.UserRepo = userRepo; this.CacheHelper = cacheHelper; }
public SimCaptchaService Set(ICacheHelper cacheHelper) { this._cacheHelper = cacheHelper; return(this); }
public AncestrySearch(ICacheHelper cacheHelper, ILogger logger) { _cacheHelper = cacheHelper; _logger = logger; }
public void SetImplementation(ICacheHelper instance) { implementation = instance; }
public static void AddUpdater( String typeName, ICacheHelper obj ) { dic.Add( typeName, obj ); }
/// <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; }
public QueueDataModel(ICacheHelper cacheHelper) { this._cacheHelper = cacheHelper; }
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; }
/// <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; }
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); }
public RequestPasswordService(IRequestPasswordRepository repository, ICustomerRepository userRepository) { _repository = repository; _userRepository = userRepository; _cacheHelper = ObjectFactory.GetInstance<ICacheHelper>(); }
public ArticeService(IArticeRepository repository, ICacheHelper cacheHelper) { _repository = repository; _cacheHelper = cacheHelper; }
public ReferenceDocumentsLibraryController(IDocumentLibraryViewModelFactory viewModelFactory, IDocumentSubTypeService documentSubTypeService, ICacheHelper cacheHelper) { _viewModelFactory = viewModelFactory; _documentSubTypeService = documentSubTypeService; _cacheHelper = cacheHelper; }
public DependencyResolver(ICacheHelper cacheHelper) { _cacheHelper = cacheHelper; }
public UserSessionRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory) { _cacheHelper = cacheHelper; _sqlObjectFactory = sqlObjectFactory; }
public ForumExpirationChecker( ICacheHelper cacher ) { this.cacher = cacher; }
public FileDataModel(ICacheHelper cacheHelper, IApplicationConfig applicationConfig) { this._cacheHelper = cacheHelper; this._applicationConfig = applicationConfig; }
public HomeController(ICacheHelper cacheHelper) { CacheHelper = cacheHelper; }
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 LedgerSheet(LedgerContext ledger, ICacheHelper cache) { _ledger = ledger; _cache = cache; }
public ContactUsService(ISystemEmailTemplateRepository repository) { _repository = repository; _cacheHelper = ObjectFactory.GetInstance<ICacheHelper>(); }
public TopicRepository(ISqlObjectFactory sqlObjectFactory, ICacheHelper cache) { _sqlObjectFactory = sqlObjectFactory; _cache = cache; }