Exemple #1
0
        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);
            }
        }
Exemple #2
0
 public async Task <IActionResult> Delete(int id)
 {
     return(await DeleteAsync(
                async() => await _PriorityService.PriorityExistsAsync(id),
                async() => await _PriorityService.DeleteAsync(id)));
 }