public IHttpActionResult GetUserRoleID(int id) { try { string accessToken = Request.Headers.Authorization == null ? null : Request.Headers.Authorization.Parameter; int userRoleId = _service.GetUserRoleID(id, accessToken); if (userRoleId > 0) { return(Content(HttpStatusCode.OK, userRoleId)); } else { return(Content(HttpStatusCode.OK, "Content not found id = " + id)); } } catch (Exception ex) { Logger.WriteException("GetUserRoleID : ", ex); return(Content(HttpStatusCode.BadRequest, ex.Message)); } }