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