Пример #1
0
 public IActionResult OnPostSave()
 {
     foreach (var people in PeopleList)
     {
         peopleData.AddPeople(people);
     }
     peopleData.Commit();
     return(RedirectToPage("../PeoplePage/List"));
 }
Пример #2
0
 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());
 }