Ejemplo n.º 1
0
 public XOrder(long id, decimal totalPrice, string address, EXDeliveryMethod deliveryMethod, EXOrderStatus orderStatus, List <XOrderItem> orderItems)
 {
     ID             = id;
     TotalPrice     = totalPrice;
     Address        = address;
     DeliveryMethod = deliveryMethod;
     OrderStatus    = orderStatus;
     OrderItems     = orderItems;
 }
        public static EDeliveryMethod ToEntity(this EXDeliveryMethod method)
        {
            switch (method)
            {
            case EXDeliveryMethod.Delivery:
                return(EDeliveryMethod.Delivery);

            case EXDeliveryMethod.PickUp:
                return(EDeliveryMethod.PickUp);

            default:
                throw new ArgumentOutOfRangeException($"Unknown delivery method: {method}");
            }
        }