public void InsertPerson(Person person) { ctx.People.Add(person); //Since we have not implement address boxes... person.Address = new Address(); ctx.SaveChanges(); //Redirect clients on every POST request (only if they succeeded) Response.Redirect(Request.RawUrl); }
public void UpdatePerson(Person personUpdated) { var person = ctx.People.Find(personUpdated.Id); person.FirstName = personUpdated.FirstName; person.LastName = personUpdated.LastName; person.Email = personUpdated.Email; ctx.SaveChanges(); //Redirect clients on every POST request (only if they succeeded) Response.Redirect(Request.RawUrl); }