public static BillingAddress ConvertToDomain(BillingAddressModel model)
        {
            if (model == null)
                throw new ArgumentNullException("model");

            return new BillingAddress(model.FirstName, model.FirstName, model.Address,
                model.City, model.State, model.ZipCode, model.Country);
        }
        public static BillingAddress ConvertToDomain(BillingAddressModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            return(new BillingAddress(model.FirstName, model.FirstName, model.Address,
                                      model.City, model.State, model.ZipCode, model.Country));
        }
예제 #3
0
        public static CustomerInfo ConvertToDomain(CustomerInfoModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            if (model.BillingAddress == null)
            {
                throw new ArgumentNullException("model.BillingAddress");
            }
            if (model.ShippingAddress == null)
            {
                throw new ArgumentNullException("model.ShippingAddress");
            }

            var billigAddress   = BillingAddressModel.ConvertToDomain(model.BillingAddress);
            var shippingAddress = ShippingAddressModel.ConvertToDomain(model.ShippingAddress);

            return(new CustomerInfo(model.Email, model.CustomerId, billigAddress,
                                    shippingAddress, model.CustomerIP));
        }