public async Task <ActionResult> Update(int id, CreateOrUpdateTrainerRequest request) { try { await _manager.UpdateTrainer(id, request); return(RedirectToAction(nameof(ShowTrainers))); } catch (ArgumentNullException) { return(RedirectToAction("ErrorPage", nameof(Main), new { message = "Error: can not update trainer", call = nameof(Trainer) })); } catch (DbUpdateException) { return(RedirectToAction("ErrorPage", nameof(Main), new { message = "Error: invalid input", call = nameof(Trainer) })); } }