public void Save(ShippingMethod shippingMethod)
 {
     throw new NotImplementedException();
 }
Esempio n. 2
0
        public void SetShippingMethod(ShippingMethod shippingMethod)
        {
            if(ShippingContact == null)
                throw new Exception($"Shipping method cannot be set before a shipping address has been set");

            if(GetValidShippingMethods().FirstOrDefault(sm => sm.Code == shippingMethod.Code) == null)
                throw new Exception($"Shipping method {shippingMethod.Code} is not valid for country {ShippingContact.Country}");

            ShippingMethod = shippingMethod;
        }