public OrderView GetOrder(int targetId, OrderTypeEnum orderType) { var orderTypeStrategy = OrderTypeFactory.GetOrderTypeStrategy(orderType); var order = orderTypeStrategy.GetOrderReview(targetId); order.Total = order.OrderDetails.Sum(x => x.Product.Price * x.Quantity); return(order); }
public void ChechoutOrder(OrderView order) { var orderTypeStrategy = OrderTypeFactory.GetOrderTypeStrategy((OrderTypeEnum)order.OrderTypeInt); orderTypeStrategy.CheckoutOrder(order); }