예제 #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);
        }
예제 #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;
 }
예제 #3
0
 public ProductsController(IProductService productService, ICategoryService categoryService, IShippingCalculatorService shippingService)
 {
     _productService = productService;
     _categoryService = categoryService;
     _shippingService = shippingService;
 }