Exemple #1
0
        public async Task <IActionResult> DeleteAsync(int id)
        {
            var result = await _sportService.DeleteAsync(id);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }

            var resource = _mapper.Map <Sport, SportResource>(result.Sport);

            return(Ok(resource));
        }
Exemple #2
0
        public async Task <IActionResult> DeleteAsync(int id)
        {
            var result = await _sportService.DeleteAsync(id);

            if (!result.Success && result.Error.Status == 404)
            {
                return(NotFound(result.Error));
            }

            if (!result.Success)
            {
                return(BadRequest(result.Error));
            }

            return(Ok(result.Result));
        }