public RemoveCartController(IProductCache productCache, IKafkaLogger kafkaLogger, IHostCache hostCache, IOptions <ScriptAPISetting> options)
 {
     _kafkaLogger    = kafkaLogger;
     _hostCache      = hostCache;
     _productCache   = productCache;
     _configurations = options.Value;
 }
Example #2
0
 public BuyCartController(IHostScriptChecker hostScriptChecker, IProductCache productCache, IKafkaLogger kafkaLogger, IErrorLogger errorLogger, IOptions <ScriptAPISetting> options, IHostCache hostDictionary)
 {
     _kafkaLogger       = kafkaLogger;
     _configurations    = options.Value;
     _hostScriptChecker = hostScriptChecker;
     _productCache      = productCache;
     _errorLogger       = errorLogger;
     _hostDictionary    = hostDictionary;
 }
Example #3
0
 public FavController(IProductCache productCache, IHostScriptChecker hostScriptChecker, IKafkaLogger kafkaLogger, IHostCache hostCache, IErrorLogger errorLogger, IOptions <ScriptAPISetting> options)
 {
     _kafkaLogger       = kafkaLogger;
     _hostScriptChecker = hostScriptChecker;
     _configurations    = options.Value;
     _hostCache         = hostCache;
     _productCache      = productCache;
     _errorLogger       = errorLogger;
 }
Example #4
0
 public ProductAppService(IRepository <Mall_Product> productRepository
                          , IRepository <Mall_AttachFile> fileRepository
                          , IRepository <Mall_Category> categoryRepository
                          , IProductCache productCache) : base(productRepository)
 {
     _productRepository  = productRepository;
     _fileRepository     = fileRepository;
     _categoryRepository = categoryRepository;
     _productCache       = productCache;
 }
Example #5
0
 public AdToCartController(IOptions <ScriptAPISetting> conf, IHostScriptChecker hostScriptChecker, IKafkaLogger kafkaLogger, IProductCache productCache, IErrorLogger errorLogger, ITotalVisitUpdater totalVisitUpdater, IHostCache hostCache)
 {
     _kafkaLogger       = kafkaLogger;
     _errorLogger       = errorLogger;
     _hostScriptChecker = hostScriptChecker;
     _hostCache         = hostCache;
     _productCache      = productCache;
     _totalVisitUpdater = totalVisitUpdater;
     _configurations    = conf.Value;
 }
 public ProductUpdateController(IHostCache hostCache, IHostScriptChecker hostScriptChecker, IProductCache productCache, ICrowlerCache crowlerCache, IKafkaLogger kafkaLogger, ICategoryLogger categoryLogger, IErrorLogger errorLogger, IOptions <ScriptAPISetting> options, ITotalVisitUpdater totalVisitUpdater)
 {
     _kafkaLogger       = kafkaLogger;
     _categoryLogger    = categoryLogger;
     _hostScriptChecker = hostScriptChecker;
     _productCache      = productCache;
     _errorLogger       = errorLogger;
     _crowlerCache      = crowlerCache;
     _configurations    = options.Value;
     _hostCache         = hostCache;
     _totalVisitUpdater = totalVisitUpdater;
 }
Example #7
0
        public NewProductEventProcessor(
            ILogger <NewProductEventProcessor> logger,
            IEventSubscriber eventSubscriber,
            IProductRepository productRepository,
            IProductCache productCache
            )
        {
            this.logger     = logger;
            this.subscriber = eventSubscriber;
            this.subscriber.ProductAddedEventReceived += (prd) => {
                //if (prd?.Product != null)
                //{
                //    productRepository.AddProduct(prd.Product);
                //    productCache.Put(prd.Product);
                //}
                //else if (prd?.Catagory != null)
                //{
                //    productRepository.AddCatagory(prd.Catagory);
                //}

                var product = new Product()
                {
                    ProductName = prd.ProductName,
                    ProductId   = prd.ProductId,
                    Description = prd.Description,
                    Price       = prd.Price,
                    CatagoryId  = prd.CatagoryId,
                };
                productRepository.AddProduct(product);
                productRepository.AddCatagory(
                    new Catagory
                {
                    CatagoryId   = prd.CatagoryId,
                    CatagoryCode = prd.CatagoryCode,
                    CatagoryDesc = prd.CatagoryDesc,
                    CatagoryName = prd.CatagoryName
                });

                productCache.Put(product);
            };
        }
Example #8
0
        public NewProductEventProcessor(
            ILogger <NewProductEventProcessor> logger,
            IEventSubscriber eventSubscriber,
            IProductRepository productRepository,
            IProductCache productCache
            )
        {
            this.logger     = logger;
            this.subscriber = eventSubscriber;
            this.subscriber.ProductAddedEventReceived += (prd) => {
                var newProduct = new Product
                {
                    Name      = prd.Name,
                    ProductId = prd.ProductId,
                    Category  = prd.Category
                };
                productRepository.Add(newProduct);

                productCache.Put(newProduct);
            };
        }
 public ProductService(IProductCache cache, IProductRepository repository, IMsmqHelper msmq) : base(msmq)
 {
     _cache      = cache;
     _repository = repository;
 }
Example #10
0
 public ProductsController(IProductCache productCache)
 {
     _productCache = productCache;
 }
Example #11
0
 public ProductRepository(ProductDbContext dbContext, IProductCache cache)
 {
     this.dbContext = dbContext;
     this.cache     = cache;
 }
Example #12
0
 public TariffComparisonManager(IProductCache productCache)
 {
     _productCache = productCache;
 }
 public ProductController(
     IProductRepository productRepository, IProductCache productCache)
 {
     this.productRepository = productRepository;
     this.productCache      = productCache;
 }
Example #14
0
 //In this step products can be loaded from db
 //buit for this challenge we will hardcode them
 private void ProductSeed(IProductCache cache)
 {
     cache.InsertProduct(new ProductA("basic electricity tariff", 22, 5));
     cache.InsertProduct(new ProductB("Packaged tariff", 30, 4000, 800));
 }
Example #15
0
 public EntitiesManager(IProductCache cache)
 {
     prCache = cache;
 }
Example #16
0
 public ProductCacheTest()
 {
     _sut = new ProductCache(null);
 }
Example #17
0
 public HomeController(IProductCache productCache)
 {
     _productCache = productCache;
 }