Exemplo n.º 1
0
        public async Task <ActionResult> AddTeam(TeamAddModel team)
        {
            if (ModelState.IsValid)
            {
                await teamService.Add(team);

                return(RedirectToAction("Index"));
            }
            else
            {
                var model = await teamService.GetTeamWithCountries();

                return(View("Add", model));
            }
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> AddTeam(TeamAddModel team)
        {
            if (!ModelState.IsValid)
            {
                return(this.InternalServerError());
            }
            try
            {
                await services.Add(team);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }