Exemplo n.º 1
0
        public void CalculateShipping(IShippingCalculatorService shippingCalculator)
        {
            if (Status != OrderStatus.New)
            {
                throw new OrdersDomainException($"An order's shipping cost cannot be modified after the order is placed.");
            }

            ShippingCost = shippingCalculator.CalculateShippingCost(ShippingAddress);
        }
Exemplo n.º 2
0
 public CartController(ICartContext cartContext,
     IProductService productService,
     IShippingCalculatorService shippingService,
     IProfileService profileService,
     IPaymentService paymentService,
     ISysConfig config,
     IOrderService orderService, ITemplateService templateService, INotificationService notificationService)
 {
     _cartContext = cartContext;
     _productService = productService;
     _shippingService = shippingService;
     _profileService = profileService;
     _paymentService = paymentService;
     _config = config;
     _orderService = orderService;
     _templateService = templateService;
     _notificationService = notificationService;
 }
Exemplo n.º 3
0
 public ProductsController(IProductService productService, ICategoryService categoryService, IShippingCalculatorService shippingService)
 {
     _productService = productService;
     _categoryService = categoryService;
     _shippingService = shippingService;
 }