//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))); }
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); }
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); }