public void Checkout(CheckoutParameter checkoutParameter) { foreach (var product in checkoutParameter.CartParameter.Products) { var orderCommand = new OrderCommand { CustomerId = checkoutParameter.CustomerId, CartId = checkoutParameter.CartParameter.CartId, ProductId = product.ProductId, ItemCount = product.ItemCount }; _orderCommandHandler.Handle(orderCommand); } }
public IActionResult CheckoutProduct([FromBody] CheckoutParameter checkoutParameter) { _checkoutService.Checkout(checkoutParameter); return(Ok()); }