public ActionResult CreateCustomer() { var model = new CustomerModel(); model.CustomerId = Guid.NewGuid(); var billingAddress = new AddressModel { AddressId = Guid.NewGuid(), AddressTypeId = 0, CustomerId = model.CustomerId }; var shippingAddress = new AddressModel { AddressId = Guid.NewGuid(), AddressTypeId = 1, CustomerId = model.CustomerId }; model.AddressList = new List<AddressModel> {billingAddress, shippingAddress}; return View(model); }
public void AddressFromAddressModel(Address a, AddressModel model) { a.AddressId = model.AddressId; a.AddressTypeId = model.AddressTypeId; a.CustomerId = model.CustomerId; a.StreetAddress = model.StreetAddress; a.City = model.City; a.State = model.State; a.Zip = model.Zip; }