public HttpResponseMessage Get(string id) { try { int user_id = Convert.ToInt32(((ClaimsIdentity)(User.Identity)).FindFirst("id").Value); preg_question data = dao.GetItemByID(Convert.ToInt32(id)).Where(c => c.custom_question_by_user_id == null || c.custom_question_by_user_id == user_id).FirstOrDefault(); if (data != null) { return(Request.CreateResponse(HttpStatusCode.OK, data)); } else { HttpError err = new HttpError(SysConst.DATA_NOT_FOUND); return(Request.CreateErrorResponse(HttpStatusCode.NotFound, err)); } } catch (Exception ex) { HttpError err = new HttpError(ex.Message); return(Request.CreateErrorResponse(HttpStatusCode.NotFound, err)); } }