public async Task <IActionResult> DeleteUser(int id) { bool retval; try { retval = await _context.DeleteUser(id); } catch (Exception ex) { throw new HttpResponseException("An error occured whilst processing the request", ex); } if (!retval) { throw new HttpResponseException("An error occured whilst deleting the user", new Exception("DeleteUser error")); } return(Ok("User deleted")); }