Example #1
0
 public NewProductEventProcessor(
     ILogger <NewProductEventProcessor> logger,
     IEventSubscriber eventSubscriber,
     IProductManagementRepository productRepository
     )
 {
     this.logger     = logger;
     this.subscriber = eventSubscriber;
     this.subscriber.ProductAddedEventReceived += (prd) => {
         if (prd?.Product != null)
         {
             productRepository.AddProduct(prd.Product);
         }
         else if (prd?.Catagory != null)
         {
             productRepository.AddCatagory(prd.Catagory);
         }
         //productRepository.Add(new Product()
         //{
         //    ProductName = prd.Name,
         //    ProductId = prd.ProductId,
         //    Catagory = prd.Category
         //});
     };
 }
Example #2
0
 public ProductController(
     ILogger <ProductController> logger,
     IProductManagementRepository prodRepo
     ) : base()
 {
     _logger   = logger;
     _prodRepo = prodRepo;
 }
Example #3
0
        public ProductManagementService(
            AppSetting appSetting,
            IProductManagementRepository productManagementRepository)
        {
            this._appSetting = appSetting;

            this._productManagementRepository = productManagementRepository;
        }
Example #4
0
 public ProductManagementService(IProductManagementRepository dal)
 {
     _dal         = dal;
     base.BaseDal = dal;
 }
Example #5
0
 public ProductController(
     IProductManagementRepository productRepository)
 {
     this.productRepository = productRepository;
 }