예제 #1
0
        public async Task <IActionResult> Delete(Guid id)
        {
            PlayerDto playerDto = await playerManager.GetAsync(id);

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

            if (await playerManager.DeleteAsync(playerDto))
            {
                return(NoContent());
            }

            ModelState.AddModelError("Player", $"Failed to delete playerId - {id}");

            return(BadRequest(ModelState));
        }
        public async Task <IActionResult> Delete(int id)
        {
            await _playerManager.DeleteAsync(id);

            return(Ok(new ApiResponse(_localizationService, _logger).Ok(true)));
        }