public async Task <ApiResponse> Delete(int id) { try { await priorityService.DeleteAsync(id); return(new ApiResponse(InfoMessages.PriorityRemoved, null, HttpStatusCode.OK.ToInt())); } catch (CustomException ex) { throw new ApiException(ex, ex.StatusCode); } catch (Exception ex) { throw new ApiException(ex); } }
public async Task <IActionResult> Delete(int id) { return(await DeleteAsync( async() => await _PriorityService.PriorityExistsAsync(id), async() => await _PriorityService.DeleteAsync(id))); }