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