public IActionResult BanPlayer(int id, string reason) { try { service.BanPlayer(id, reason); } catch (ArgumentOutOfRangeException e) { return(this.View("Error", new InvalidActionViewModel() { ErrorMessage = e.Message })); } string redirectStr = "Detail/" + id; return(this.RedirectToAction(redirectStr, "Player")); }