//Automatically sets a draw up according to specifications is DrawCreationDTO.
        public IActionResult PostAutomaticCreation(DrawCreationDTO dto)
        {
            var drawCreation = _mapper.FromCreationDTO(dto);
            var result       = _drawService.CreateAutomatic(drawCreation);

            return(Ok(_mapper.ToDTO(result)));
        }
示例#2
0
        public DrawCreationDTO ToCreationDTO(DrawCreation drawCreation)
        {
            var dto = new DrawCreationDTO()
            {
                TournamentId    = drawCreation.TournamentId,
                playerIds       = drawCreation.playerIds,
                DrawTypeDTO     = DrawTypeToDTO(drawCreation.DrawType),
                Name            = drawCreation.Name,
                Games           = drawCreation.Games,
                Points          = drawCreation.Points,
                TieBreaks       = drawCreation.TieBreaks,
                playerIdsSeeded = drawCreation.playerIdsSeeded
            };

            return(dto);
        }
示例#3
0
        public DrawCreation FromCreationDTO(DrawCreationDTO dto)
        {
            DrawCreation drawCreation = new DrawCreation()
            {
                TournamentId    = dto.TournamentId,
                playerIds       = dto.playerIds,
                DrawType        = DrawTypeFromDTO(dto.DrawTypeDTO),
                Name            = dto.Name,
                Games           = dto.Games,
                Points          = dto.Points,
                TieBreaks       = dto.TieBreaks,
                playerIdsSeeded = dto.playerIdsSeeded
            };

            return(drawCreation);
        }