示例#1
0
 public void Post([FromBody] Tournament tournament)
 {
     _tournamentService.CreateTournament(tournament);
     RedirectToAction("Post", "Event", new Event()
     {
         TournamentId = tournament.TournamentId
     });
 }
示例#2
0
        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));
 }