Exemplo n.º 1
0
        public Response <TournamentDTO> Post([FromBody] TournamentDTO tournamentDto)
        {
            Response <TournamentDTO> response = new Response <TournamentDTO>();
            Tournament t = tournamentDto.ConvertToTournament(null);

            _tournamentAppCRDService.Save(t);
            response.data     = tournamentDto.ConvertTournamentToDTO(t);
            response.messages = _tournamentAppCRDService.GetMessages();
            return(response);
        }
Exemplo n.º 2
0
        public Response <TournamentDTO> Put([FromBody] TournamentDTO tournamentDto)
        {
            Response <TournamentDTO> response = new Response <TournamentDTO>();
            Tournament newtournament          = _tournamentAppCRDService.GetById(tournamentDto.Id);

            newtournament = tournamentDto.ConvertToTournament(newtournament);
            _tournamentAppCRDService.Update(newtournament);
            response.data     = tournamentDto.ConvertTournamentToDTO(newtournament);
            response.messages = _tournamentAppCRDService.GetMessages();
            return(response);
        }