public HttpResponseMessage Init([FromBody] Models.UserMenuState.Init userPref) { MenuServices service = new MenuServices(); try { service.MenuStateInit(userPref); return(Request.CreateResponse(HttpStatusCode.OK, "UserMenuState successfully inititialized.")); } catch (Exception ex) { ex.Data.Add("UserID", userPref.UserID); ex.Data.Add("HTTPReferrer", "JCRAPI/MenuInfo/MenuStateInit"); WebExceptionHelper.LogException(ex, null); return(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, ex.Message)); } }