Esempio n. 1
0
        public async Task <IActionResult> GetByIdAsync(Guid id)
        {
            var player = await _playerService.GetByIdAsync(id);

            if (player != null)
            {
                return(Ok(PlayerAdapter.ToPlayerDTO(player)));
            }

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> GetAsync()
        {
            var players = await _playerService.GetAllAsync();

            if (players.Any())
            {
                return(Ok(players.Select(x => PlayerAdapter.ToPlayerDTO(x))));
            }

            return(NoContent());
        }