public async Task <ActionResult> Create(TournamentViewModel tournamentViewModel, IFormFile logo) { try { if (ModelState.IsValid) { var tournament = _mapper.Map <Tournament>(tournamentViewModel); tournament.LogoPath = await logo.SaveImage(_hostEnvironment.WebRootPath, ImgPath); await _tournamentService.AddAsync(tournament); return(RedirectToAction(nameof(Index))); } return(View(tournamentViewModel)); } catch { return(View(tournamentViewModel)); } }