public ActionResult Add(int id) { var list = repo.Find(id); var vm = new AddressViewModel { PersonId = id, Addresses = list.ToArray() }; return View(vm); }
public ActionResult Add(Address a) { repo.Add(a); var list = repo.Find(a.PersonId); var vm = new AddressViewModel { PersonId = a.PersonId, Addresses = list.ToArray() }; return View(vm); }