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