public async Task <IActionResult> Edit(int competitionId, int competitionInstanceId, CompetitionsInstanceViewModel model) { if (competitionInstanceId != model.Id) { return(NotFound()); } if (ModelState.IsValid) { var compInstance = await _competitionService.GetCompetitionInstanceByIdAsync(model.Id); await _competitionService.EditInstanceAsync(compInstance, model); return(RedirectToAction("Competition", "Admin", new { @competitionId = compInstance.CompetitionId })); } return(View(model)); }