public ActionResult CreateNew(TeamBindingModel team)
        {
            if (!ModelState.IsValid)
            {
                return(View("TeamForm", team));
            }

            var newTeam = _factory.CreateNewTeam(team);

            _context.Teams.Add(newTeam);


            _context.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public IHttpActionResult Create(TeamBindingModel teamDto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var team = _factory.CreateNewTeam(teamDto);

            _context.Teams.Add(team);
            _context.SaveChanges();

            var dto = _factory.FromTeamToDto(team);

            return(Created(new Uri(Request.RequestUri + "/" + dto.Id), dto));
        }