public async Task <IActionResult> Delete(int id) { try { var result = await _service.Delete(id).ConfigureAwait(false); return(Ok(result)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <ActionResult> Delete(int id) { try { VerifyUser(); await _overtimeService.Delete(id); return(NoContent()); } catch (Exception e) { var result = new ResultFormatter(API_VERSION, General.INTERNAL_ERROR_STATUS_CODE, e.Message) .Fail(); return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, result)); } }