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)); } }
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)); } }