public async Task <ActionResult> DeleteProfile(int id) { try { await _context.DeleteProfile(id); return(new NoContentResult()); } catch (ControllerNotFoundException e) { return(NotFound(e.Message)); } catch (ControllerBadRequestException e) { return(BadRequest(e.Message)); } catch (ControllerUnauthorizedException) { return(new UnauthorizedResult()); } }