Example #1
0
 public Order(User user, IEnumerable <ProductOrder> productOrders, OrderDiscount orderDiscount, Shipment shipment, Payment payment,
              decimal basePrice, decimal finalPrice, string comment, Address address)
 {
     IsClosed  = false;
     Comment   = comment;
     BasePrice = basePrice;
     SetShipment(shipment);
     SetPayment(payment);
     CreationDateTime = DateTimeOffset.UtcNow;
     AddProductOrders(productOrders);
     SetDiscount(orderDiscount);
     SetAddress(address);
     FinalPrice = finalPrice;
     SetUser(user);
     DiscountValue = orderDiscount?.PercentValue;
 }
Example #2
0
 public void SetDiscount(OrderDiscount discount)
 => OrderDiscount = discount;