public void Post([FromBody] Tournament tournament) { _tournamentService.CreateTournament(tournament); RedirectToAction("Post", "Event", new Event() { TournamentId = tournament.TournamentId }); }
public IHttpActionResult PostTournament(TournamentOptions options) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var tournament = _tournamentService.CreateTournament(options.PlayerNames); return(CreatedAtRoute("DefaultApi", new { id = tournament.Id }, tournament)); }
public async Task <Tournament> CreateTournament([FromBody] Tournament Tournament) { return(await _TournamentService.CreateTournament(Tournament)); }