public async Task <IActionResult> EditScore(BetMatchBindingModel model, int id, string returnUrl = "/") { if (!ModelState.IsValid) { this.ModelState.AddModelError(string.Empty, "Validation error."); return(View(moderationService.PrepareMatchScore(id))); } try { var result = await moderationService.EditMatchScoreAsync(id, model.HomeTeamGoals, model.GuestTeamGoals); if (result != null) { this.ModelState.AddModelError(string.Empty, result); return(View(new BetMatchBindingModel())); } return(Redirect(returnUrl)); } catch { return(Redirect("/")); } }