Example #1
0
        public IActionResult Post([FromBody] SportsBuildingAdministrator sportsBuildingAdmin)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            repository.SaveSportsBuildingAdministrator(sportsBuildingAdmin);
            return(CreatedAtAction(nameof(Get),
                                   new { id = sportsBuildingAdmin.SportsBuildingAdministratorID }, sportsBuildingAdmin));
        }
 public IActionResult EditSportsBuildingAdministrator(SportsBuildingAdministrator sportsBuildingAdministrator)
 {
     if (ModelState.IsValid)
     {
         repository.SaveSportsBuildingAdministrator(sportsBuildingAdministrator);
         return(RedirectToAction("SportsBuildingAdministrator"));
     }
     else
     {
         // there is something wrong with the data values.
         return(View(sportsBuildingAdministrator));
     }
 }