Example #1
0
        public async Task <IActionResult> DeletePlayerAsync(int id)
        {
            var player = await _playerRepository.GetPlayerByIDAsync(id);

            if (player == null)
            {
                return(NotFound());
            }


            if (!await _playerRepository.DeletePlayersAsync(player))
            {
                throw new Exception("Problem while saving..");
            }

            return(NoContent());
        }