public async Task <IActionResult> Create(CoachViewModel coach, IFormFile ava) { if (!ModelState.IsValid || coach == null) { ViewBag.Error = CreateError(); return(View("Error")); } var coachDto = _mapper.Map <CoachDTO>(coach); var addedCoach = await _сoachService.Create(coachDto, ava, true); await UpdateTeam(coach.TeamId, addedCoach.Id); return(RedirectToAction("Index")); }