public IActionResult OnPostSave() { foreach (var people in PeopleList) { peopleData.AddPeople(people); } peopleData.Commit(); return(RedirectToPage("../PeoplePage/List")); }
public IActionResult OnPost() { Genders = htmlHelper.GetEnumSelectList <GenderType>(); if (ModelState.IsValid) { if (PeopleEntity.Id > 0) { peopleData.UpdatePeople(PeopleEntity); } else { peopleData.AddPeople(PeopleEntity); } peopleData.Commit(); return(RedirectToPage("./List")); } return(Page()); }