コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }