Esempio n. 1
0
        public async Task <IActionResult> CreateTeam(string textTeam)
        {
            _logger.LogInformation("create team");
            await team.CreateTeamAsync(textTeam, User.Identity.Name);

            return(RedirectToAction("Index", "Home"));
        }
        public async Task <IActionResult> Create(TeamViewModel viewModel)
        {
            try
            {
                Team mapTeam = TeamMapper.MapTeam(viewModel);
                Team team    = await _teamServices.CreateTeamAsync(mapTeam);

                return(RedirectToAction("Index", new { id = team.TeamId }));
            }
            catch (GlobalException e)
            {
                return(BadRequest(e.Message));
            }
        }