/// <summary> /// Initializes a new instance of the <see cref="DynamicContentClient" /> class. /// </summary> /// <param name="contentRepository">The content repository.</param> /// <param name="service">The service.</param> /// <param name="customerSession">The customer session.</param> /// <param name="cacheRepository">The cache repository.</param> public DynamicContentClient(IDynamicContentRepository contentRepository, IDynamicContentService service, ICustomerSessionService customerSession, ICacheRepository cacheRepository) { _cacheRepository = cacheRepository; _customerSession = customerSession; _service = service; _isEnabled = DynamicContentConfiguration.Instance.Cache.IsEnabled; }
/// <summary> /// Initializes a new instance of the <see cref="DisplayTemplateClient" /> class. /// </summary> /// <param name="service">The service.</param> /// <param name="customerSession">The customer session.</param> /// <param name="cacheRepository">The cache repository.</param> public DisplayTemplateClient(IDisplayTemplatesService service, ICustomerSessionService customerSession, ICacheRepository cacheRepository) { _cacheRepository = cacheRepository; _customerSession = customerSession; _service = service; _isEnabled = AppConfigConfiguration.Instance.Cache.IsEnabled; }
public AdjustInventoryActivity(ICatalogRepository catalogRepository, IInventoryRepository inventoryRepository, ICustomerSessionService customerService, ICacheRepository cacheRepository) { _catalogRepository = catalogRepository; _inventoryRepository = inventoryRepository; _cacheRepository = cacheRepository; _customerSessionService = customerService; }
public OrderClient(IOrderStateController stateController, IOrderRepository orderRepository, ICacheRepository cacheRepository) { _stateController = stateController; _orderRepository = orderRepository; _cacheRepository = cacheRepository; }
public DataLibrarian(string nflConnection, string tflConnection, string ctlConnection) { try { Logger = LogManager.GetCurrentClassLogger(); // Connect to a database OleDbConn = new OleDbConnection(nflConnection); // This is the default (ie dont return deleted records) OleDbConn.Open(); var cmd = new OleDbCommand("SET DELETED ON", OleDbConn); cmd.ExecuteNonQuery(); OleDbConnTycoon = new OleDbConnection(tflConnection); OleDbConnControl = new OleDbConnection(ctlConnection); NflConnectionString = nflConnection; #if DEBUG Debug.WriteLine(message: string.Format("Data Librarian connected to {0}", nflConnection)); #endif cache = new RedisCacheRepository(); } catch (Exception ex) { Logger.ErrorException(string.Format("Connection failed: {0}>>{1}", nflConnection, ex.Message), ex); throw; } }
public AdministratorController(IDictionaryRepository dictionaryRepository, ICacheRepository cacheRepository, IUserRepository userRepository) : base(userRepository) { this.dictionaryRepository = dictionaryRepository; this.cacheRepository = cacheRepository; this.dictionaryModel = new DictionaryModel(); }
public when_adding_bands_to_the_cache() { _repository = new CacheDataRepository(); _band = new Band(); _clearing = new ClearData(_repository); _readRepository = new DataProviderRepository(); }
/// <summary> /// Initializes the <see cref="StoreClient"/> class. /// </summary> public StoreClient(IStoreRepository storeRepository, ICustomerSessionService customerSession, ICacheRepository cacheRepository) { _storeRepository = storeRepository; _cacheRepository = cacheRepository; _customerSession = customerSession; _isEnabled = StoreConfiguration.Instance.Cache.IsEnabled; }
public MediaController(IMediaRepository mediaRepository, ICacheRepository cacheRepository, IUserRepository userRepository) : base(userRepository) { this.mediaRepository = mediaRepository; this.cacheRepository = cacheRepository; this.model = new MultiMediaModel(); }
public when_refreshing_objects_in_the_cache() { _repository = new CacheDataRepository(); _readRepository = new DataProviderRepository(); _clearing = new ClearData(_repository); _refreshing = new RefreshData(_repository); }
public UserClient(ISecurityRepository securityRepository, ICustomerRepository customerRepository, ICustomerSessionService customerSession, ICacheRepository cacheRepository) { _securityRepository = securityRepository; _customerRepository = customerRepository; _cacheRepository = cacheRepository; _customerSession = customerSession; _isEnabled = CustomerConfiguration.Instance.Cache.IsEnabled; }
public when_adding_sale_data_to_the_cache() { _repository = new CacheDataRepository(); _sale = new Sale(); _clearing = new ClearData(_repository); _readRepository = new DataProviderRepository(); }
public DisplayTemplateEvaluator(IAppConfigRepository repository, IEvaluationPolicy[] policies, ICacheRepository cache) :base(cache) { _repository = repository; _policies = policies; IsEnabled = AppConfigConfiguration.Instance != null && AppConfigConfiguration.Instance.Cache.IsEnabled; Cache = new CacheHelper(cache); }
/// <summary> /// Initializes a new instance of the <see cref="PriceListClient" /> class. /// </summary> /// <param name="priceListRepository">The price list repository.</param> /// <param name="customerSession">The customer session.</param> /// <param name="priceListEvaluator">The price list evaluator.</param> /// <param name="priceListEvalContext">The price list eval context.</param> /// <param name="cacheRepository">The cache repository.</param> public PriceListClient(IPricelistRepository priceListRepository, ICustomerSessionService customerSession, IPriceListAssignmentEvaluator priceListEvaluator, IPriceListAssignmentEvaluationContext priceListEvalContext, ICacheRepository cacheRepository) { _cacheRepository = cacheRepository; _priceListRepository = priceListRepository; _customerSession = customerSession; _priceListEvalContext = priceListEvalContext; _priceListEvaluator = priceListEvaluator; _isEnabled = CatalogConfiguration.Instance.Cache.IsEnabled; }
public DynamicContentEvaluator(IDynamicContentRepository repository, IEvaluationPolicy[] policies, ICacheRepository cache) : base(cache) { _repository = repository; _policies = policies; IsEnabled = DynamicContentConfiguration.Instance != null && DynamicContentConfiguration.Instance.Cache.IsEnabled; }
public DefaultPromotionEvaluator(IMarketingRepository repository, IPromotionUsageProvider usageProvider, IEvaluationPolicy[] policies, ICacheRepository cache) :base(cache) { _repository = repository; _usageProvider = usageProvider; _policies = policies; _isEnabled = MarketingConfiguration.Instance.Cache.IsEnabled; Cache = new CacheHelper(cache); }
/// <summary> /// Initializes the <see cref="PromotionClient" /> class. /// </summary> /// <param name="marketingRepository">The marketing repository.</param> /// <param name="customerSession">The customer session.</param> /// <param name="evaluator"></param> /// <param name="cacheRepository">The cache repository.</param> public PromotionClient(IMarketingRepository marketingRepository, ICustomerSessionService customerSession, IPromotionEvaluator evaluator, ICacheRepository cacheRepository) { _marketingRepository = marketingRepository; _cacheRepository = cacheRepository; _customerSession = customerSession; _evaluator = evaluator; }
/// <summary> /// Initializes a new instance of the <see cref="CacheService"/> class. /// </summary> /// <param name="cacheRepository">The cache repository.</param> /// <param name="outputCacheManager">The output cache manager.</param> /// <param name="storeClient"></param> /// <param name="sessionService"></param> public CacheService(ICacheRepository cacheRepository, IReadWriteOutputCacheManager outputCacheManager, ICustomerSessionService sessionService, StoreClient storeClient):this() { _cacheRepository = cacheRepository; _outputCacheManager = outputCacheManager; _storeClient = storeClient; _sessionService = sessionService; }
public static void FillCache(string xmlPath, ICacheRepository cacheRepository) { var parser = new XmlParser(xmlPath); var modules = parser.ParseXml(); var tableOfContents = new TableOfContents(modules); cacheRepository.Clear(); // By convention, the table of contents is always situated at Guid.Empty. cacheRepository.Put(CourseService.TableOfContentsKey, tableOfContents); foreach (var lesson in modules.SelectMany(x => x.Lessons)) cacheRepository.Put(lesson.Id, lesson); }
public CatalogClient(ICatalogRepository catalogRepository, ICatalogService catalogService, ICustomerSessionService customerSession, ICacheRepository cacheRepository, IInventoryRepository inventoryRepository, ICatalogOutlineBuilder catalogOutlineBuilder = null, ISearchConnection searchConnection = null) { _catalogService = catalogService; _catalogRepository = catalogRepository; _cacheRepository = cacheRepository; _customerSession = customerSession; _inventoryRepository = inventoryRepository; _searchConnection = searchConnection; _catalogOutlineBuilder = catalogOutlineBuilder; _isEnabled = CatalogConfiguration.Instance.Cache.IsEnabled; }
public TokenRepository(ICacheRepository cacheRepository) { _cacheRepository = cacheRepository; }
public Saml2MetadataController(IConfigurationRepository configurationRepository, ICacheRepository cacheRepository) { ConfigurationRepository = configurationRepository; CacheRepository = cacheRepository; }
public TpItemService(IGw2ApiRepository client, ICacheRepository cacheRepository) { _apiRepository = client; _cacheRepository = cacheRepository; }
public DeviceRepository(IDataContext context, ICacheRepository <T> cache) : this(context) { _cache = cache; }
public CalculateTaxActivity(ICatalogRepository catalogRepository, ITaxRepository taxRepository, ICacheRepository cacheRepository) { _catalogRepository = catalogRepository; _taxRepository = taxRepository; _cacheRepository = cacheRepository; }
/// <summary> /// Initializes a new instance of the <see cref="TemplateService" /> class. /// </summary> /// <param name="repository">The repository.</param> /// <param name="cacheRepository">The cache repository.</param> public TemplateService(IAppConfigRepository repository, ICacheRepository cacheRepository) { _repository = repository; _cacheRepository = cacheRepository; _isEnabled = AppConfigConfiguration.Instance.Cache.IsEnabled; }
public static void RemoveCache(ICacheRepository cache, string branchId, string customerNumber) { cache.RemoveItem(CACHE_GROUPNAME, CACHE_PREFIX, CACHE_NAME, string.Format("CustomInventoryDictionary_{0}_[1]", branchId, customerNumber)); //Invalidate cache }
public ConfigurationRepository(ICacheRepository cacheRepository) { CacheRepository = cacheRepository; }
/// <summary> /// Initializes a new instance of the <see cref="BaseController"/> class. /// </summary> /// <param name="cacheRepository">The cache repository.</param> public BaseController(ICacheRepository cacheRepository) { this.cacheRepository = cacheRepository; }
public RavenDbRepository(IRavenDbStoreHolder context, ICacheRepository <T> cache) { _cache = cache; }
public TestRepository(ICacheRepository cache) { _redisCache = cache; }
public TokenHelper(JwtOptions jwtOptions, ICacheRepository cacheRepository) { _jwtOptions = jwtOptions; _cacheRepository = cacheRepository; }
//ctors public ServerInfoApiController(ICacheRepository repository) : base(repository) { // Nowt here to see }
public SeoKeywordClient(IAppConfigRepository appConfigRepository, ICacheRepository cacheRepository) { _appConfigRepository = appConfigRepository; _cacheRepository = cacheRepository; _isEnabled = AppConfigConfiguration.Instance.Cache.IsEnabled; }
public CheckInventoryActivity(ICatalogRepository catalogRepository, ICacheRepository cacheRepository) { _catalogRepository = catalogRepository; _cacheRepository = cacheRepository; }
public FederationMetadataController(IConfigurationRepository configurationRepository, ICacheRepository cacheRepository) { ConfigurationRepository = configurationRepository; CacheRepository = cacheRepository; }
public CacheProvider(IMemcachedClient memcachedClient, ICacheRepository cacheRepository, ITracer tracer) { _tracer = tracer; _memcachedClient = memcachedClient; _cacheRepository = cacheRepository; }
public VerificationCodesService(ICacheRepository <VerificationCodeInfo> cacheRepository) { this.cacheRepository = cacheRepository; }
public CountryClient(ICountryRepository countryRepository, ICacheRepository cacheRepository) { _countryRepository = countryRepository; _cacheRepository = cacheRepository; _isEnabled = OrderConfiguration.Instance.Cache.IsEnabled; }
/// <summary> /// Initializes a new instance of the <see cref="RepositoryControllerBase"/> class. /// </summary> /// <param name="repository"> /// The repository to access data on the server. /// </param> public RepositoryControllerBase(ICacheRepository repository) : base() { this._Repository = repository; }
/// <summary> /// Get or set by type. /// Cache key is automagically created from object type and identify. /// Example: repo.GetOrSetByType{User}(1, LoadUserByIdFromDb(1)); // Get or load and set User 1 /// </summary> /// <typeparam name="T">Type of cached object</typeparam> /// <param name="repo">ICacheRepository</param> /// <param name="identifier">Type specific unique identify for object</param> /// <param name="loader">Delegate to invoke if cached item is not found</param> /// <param name="expiration">Abosolute expiration to use if object is loaded and cached</param> /// <returns>Cached object or result of loader</returns> public static T GetOrSetByType <T>(this ICacheRepository repo, object identifier, Func <T> loader, Func <T, DateTime> expiration) { var key = AsyncCacheRepositoryExtensions.CreateKey <T>(identifier); return(repo.GetOrSet(key, loader, expiration)); }
public async Task CacheUp() { Cache = new CacheRepository(); await Cache.AddGet <T>(default).ConfigureAwait(false);
/// <summary> /// Get or set by type. /// Cache key is automagically created from object type and identify. /// Example: repo.GetOrSetByType{User}(1, LoadUserByIdFromDb(1)); // Get or load and set User 1 /// </summary> /// <typeparam name="T">Type of cached object</typeparam> /// <param name="repo">ICacheRepository</param> /// <param name="identifier">Type specific unique identify for object</param> /// <param name="loader">Delegate to invoke if cached item is not found</param> /// <param name="sliding">Sliding expiration to use if object is loaded and cached</param> /// <returns>Cached object or result of loader</returns> public static T GetOrSetByType <T>(this ICacheRepository repo, object identifier, Func <T> loader, Func <T, TimeSpan> sliding) { var key = AsyncCacheRepositoryExtensions.CreateKey <T>(identifier); return(repo.GetOrSet(key, loader, sliding)); }
public CacheService(ICacheRepository cacheRepository) { _dbConnection = cacheRepository; }
/// <summary> /// Adds the repository to the repositories providers list. /// </summary> /// <param name="repository">The repository.</param> /// <returns></returns> public static ICacheRepository AddRepository(ICacheRepository repository) { AddRepository(repository, _currentPriority++); return(repository); }
public CockroachRepository(ICockRoachContext c**k, ICacheRepository <T> cache) : this(c**k) { _cache = cache; }
public void AddToCache(ICacheRepository repository) { repository.AddItemWithKey(string.Format(CacheKey, Vin), this, DateTime.Now.AddDays(1)); repository.AddItemWithKey(string.Format(CacheKey, License), this, DateTime.Now.AddDays(1)); repository.AddItemWithKey(string.Format(CacheKey, Registration), this, DateTime.Now.AddDays(1)); }
public BookingController(IConfiguration config, IVehiclesRepository vehiclesRepo, IUserTypeRepository userTypeRepository, IPubSubRepository pubSubRepository, ICacheRepository cacheRepository, IBigRepo bigRepo) { _config = config; _vehiclesRepo = vehiclesRepo; _userTypeRepository = userTypeRepository; _pubSubRepository = pubSubRepository; _cacheRepository = cacheRepository; _iBigRepo = bigRepo; }
public CalendarRepository(AppDbContext appDbContext, IConfiguration config, ICacheRepository calendarCache) { _appDbContext = appDbContext; _config = config; _calendarCache = calendarCache; }
public void AddToCache(ICacheRepository repository) { repository.AddItems<CarInformationDto>(SelectAllWithCarId); // repository.AddItemsForEach<CarInformationDto>(SelectAllWithValidCarIdAndYear); }
public RefreshData(ICacheRepository repository) { _repository = repository; _log = LogManager.GetLogger(GetType()); }
/// <summary> /// Set by type. /// Cache key is automagically created from object type and identify. /// Example: repo.SetByType{User}(1, user); // Set user by their Id /// </summary> /// <typeparam name="T">Type of cached object</typeparam> /// <param name="repo">ICacheRepository</param> /// <param name="identifier">Type specific unique identify for object</param> /// <param name="expiration">Abosolute expiration to use for cache</param> /// <param name="value">Object to be cached</param> public static void SetByType <T>(this ICacheRepository repo, object identifier, T value, DateTime expiration) { var key = AsyncCacheRepositoryExtensions.CreateKey <T>(identifier); repo.Set(key, value, expiration); }
/// <summary> /// Set by type. /// Cache key is automagically created from object type and identify. /// Cache sliding expiration is taken from the enum value or override by application configuration. /// Example: repo.SetByType{User}(1, user); // Set user by their Id /// </summary> /// <typeparam name="T">Type of cached object</typeparam> /// <param name="repo">ICacheRepository</param> /// <param name="identifier">Type specific unique identify for object</param> /// <param name="sliding">Sliding expiration to use for cache</param> /// <param name="value">Object to be cached</param> public static void SetByType <T>(this ICacheRepository repo, object identifier, T value, CacheSliding sliding) { var key = AsyncCacheRepositoryExtensions.CreateKey <T>(identifier); repo.Set(key, value, sliding); }
public ShippingClient(IShippingRepository shippingRepository, ICacheRepository cacheRepository) { _shippingRepository = shippingRepository; _cacheRepository = cacheRepository; _isEnabled = OrderConfiguration.Instance.Cache.IsEnabled; }
/// <summary> /// Get by type. /// Cache key is automagically created from object type and identify. /// Example: repo.GetByType{User}(1); // Get User 1 /// </summary> /// <typeparam name="T">Type of cached object</typeparam> /// <param name="repo">ICacheRepository</param> /// <param name="identifier">Type specific unique identify for object</param> /// <returns>Cached object, null if no record found</returns> public static T GetByType <T>(this ICacheRepository repo, object identifier) { var key = AsyncCacheRepositoryExtensions.CreateKey <T>(identifier); return(repo.Get <T>(key)); }
/// <summary> /// Remove by type. /// Cache key is automagically created from object type and identify. /// Example: repo.RemoveByType{User}(1); // Removes user 1 /// </summary> /// <typeparam name="T">Type of cached object</typeparam> /// <param name="repo">ICacheRepository</param> /// <param name="identifier">Type specific unique identify for object</param> public static void RemoveByType <T>(this ICacheRepository repo, object identifier) { var key = AsyncCacheRepositoryExtensions.CreateKey <T>(identifier); repo.Remove(key); }