public async Task <IHttpActionResult> EditStadium(StadiumModel stadium) { if (!ModelState.IsValid) { return(InternalServerError()); } try { await services.Edit(stadium); return(Ok()); } catch (Exception ex) { return(InternalServerError(ex)); } }
public async Task <ActionResult> SaveStadium(StadiumModel stadium) { if (ModelState.IsValid) { await stadiumService.Edit(stadium); return(RedirectToAction("Index")); } else { StadiumModelWithCountries model = await stadiumService.GetStadiumWithCountries(new StadiumIdModel() { Id = stadium.Id }); return(View("Edit", model)); } }