public CacheController(ILoggerFactory loggerFactory, ICachingRepository cachingRepository) { if (loggerFactory == null) { throw new ArgumentNullException(nameof(loggerFactory)); } _logger = loggerFactory.CreateLogger <CacheController>(); _cachingRepository = cachingRepository ?? throw new ArgumentNullException(nameof(cachingRepository)); _logger.LogInformation("Контроллер инициализирован."); }
public LazyLoaderController(ICachingRepository cachingRepository) { StockPriceLists = new Lazy <CacheDictionary <int, StockPricelists> >(() => { return(CacheDictionary <int, StockPricelists> .CreateDictionary(cachingRepository.GetAllStockPriceLists(), (v) => v.Id, (v) => v)); }); StockItemGroups = new Lazy <CacheDictionary <int, StockItemGroups> >(() => { return(CacheDictionary <int, StockItemGroups> .CreateDictionary(cachingRepository.GetAllStockItemGroups(), (v) => v.Id, (v) => v)); }); CatalogueItems = new Lazy <CacheDictionary <string, stCatalogue> >(() => { return(CacheDictionary <string, stCatalogue> .CreateDictionary(cachingRepository.stLoadCatalogue(), (v) => v.ItemCode, (v) => v)); }); InventoryPricing = new Lazy <CacheDictionary <string, List <stInventoryPricing> > >(() => { var inventoryPricings = cachingRepository.stGetInventoryPricing(); var values = inventoryPricings .GroupBy(g => new { g.ItemCode }) .ToDictionary(d => d.Key.ItemCode, d => d.ToList()); return(CacheDictionary <string, List <stInventoryPricing> > .CreateDictionary(values)); }); StockSets = new Lazy <IEnumerable <StockSets> >(() => { return(cachingRepository.GetAllStockSets() .Where(w => (w.Flags & (int)StockSetFlags.Disabled) == 0) .ToList()); }); StockEmbroideryPricing = new Lazy <IEnumerable <StockEmbroideryPricing> >(() => cachingRepository.GetAllStockEmbroideryPricing()); _cachingRepository = cachingRepository; }
public ModulesControllerTests(ITestOutputHelper output) : base(output) { _cachingRepository = ServiceProvider.GetService <ICachingRepository>(); _controller = new ModulesController(LoggerFactory, _cachingRepository); }
public AdminUserController(ICacheService cacheService, ICachingRepository<User, int> userRepository) { this.cacheService = cacheService; this.userRepository = userRepository; }
public CachingService(ICachingRepository cachingRepository) : base(cachingRepository) { lazyLoaderController = new LazyLoaderController(cachingRepository); }
public ProductRepository(ProductContext context, ICachingRepository cachingRepository) { _context = context; _cachingRepository = cachingRepository; }
public ManufacturerRepository(ProductContext context, ICachingRepository cachingRepository) { _context = context; _cachingRepository = cachingRepository; }
public static AccountCacheController Instance(ICachingRepository cachingRepository, LazyLoaderController lazyLoaderController) => new AccountCacheController(cachingRepository, lazyLoaderController);
public AccountCacheController(ICachingRepository cachingRepository, LazyLoaderController lazyLoaderController) { _cachingRepository = cachingRepository; this.lazyLoaderController = lazyLoaderController; }
public static InventoryCacheController Instance(ICachingRepository cachingRepository, LazyLoaderController lazyLoaderController) => new InventoryCacheController(cachingRepository, lazyLoaderController);
public InventoryCacheController(ICachingRepository cachingRepository, LazyLoaderController lazyLoaderController) { _cachingRepository = cachingRepository; _lazyLoaderController = lazyLoaderController; }
public BaseCachingService(ICachingRepository cachingRepository) { this.cachingRepository = cachingRepository; }