예제 #1
0
 public RemoveCartController(IProductCache productCache, IKafkaLogger kafkaLogger, IHostCache hostCache, IOptions <ScriptAPISetting> options)
 {
     _kafkaLogger    = kafkaLogger;
     _hostCache      = hostCache;
     _productCache   = productCache;
     _configurations = options.Value;
 }
예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #6
0
 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;
 }
예제 #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);
            };
        }
예제 #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);
            };
        }
예제 #9
0
 public ProductService(IProductCache cache, IProductRepository repository, IMsmqHelper msmq) : base(msmq)
 {
     _cache      = cache;
     _repository = repository;
 }
예제 #10
0
 public ProductsController(IProductCache productCache)
 {
     _productCache = productCache;
 }
예제 #11
0
 public ProductRepository(ProductDbContext dbContext, IProductCache cache)
 {
     this.dbContext = dbContext;
     this.cache     = cache;
 }
예제 #12
0
 public TariffComparisonManager(IProductCache productCache)
 {
     _productCache = productCache;
 }
 public ProductController(
     IProductRepository productRepository, IProductCache productCache)
 {
     this.productRepository = productRepository;
     this.productCache      = productCache;
 }
예제 #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));
 }
예제 #15
0
 public EntitiesManager(IProductCache cache)
 {
     prCache = cache;
 }
예제 #16
0
 public ProductCacheTest()
 {
     _sut = new ProductCache(null);
 }
예제 #17
0
 public HomeController(IProductCache productCache)
 {
     _productCache = productCache;
 }