public ActionResult Index(Person model) { var colorado = new AddressState { StateId = 1, StateAbbreviation = "CO" }; var missouri = new AddressState { StateId = 2, StateAbbreviation = "MO" }; model.MyAddress.States = new[] {colorado, missouri}; return View(model); }
// // GET: /Home/ public ActionResult Index() { var colorado = new AddressState {StateId = 1, StateAbbreviation = "CO"}; var missouri = new AddressState {StateId = 2, StateAbbreviation = "MO"}; var person = new Person { PersonId = 0, FirstName = "Stan", LastName = "Butler", MyAddress = new Address { AddressId = 0, Address1 = "519 Spruce", City = "Kansas City", State = missouri, Zip = "64122", States = new [] { colorado, missouri } } }; return View(person); }