// POST api/PostureLevel public IHttpActionResult Post([FromBody] PostureLevelViewModel model) { try { PostureLevelsService.AddUserPostureLevel(model, User.Identity.GetUserId()); } catch (NullReferenceException ex) { return(BadRequest()); } return(Ok()); }
// GET api/PostureLevel/5 public IHttpActionResult Get(int id) { try { PostureLevelsService.AddUserPostureLevel(new PostureLevelViewModel { UserId = "74b43350-8275-42ae-91b3-152ae1944328", Level = id }, "74b43350-8275-42ae-91b3-152ae1944328"); } catch (NullReferenceException ex) { return(BadRequest()); } return(Ok()); }
// GET api/PostureLevel/Current public PostureLevelViewModel GetCurrentLevel() { string userId = User.Identity.GetUserId(); return(PostureLevelsService.GetUserCurrentLevel(userId)); }
// GET api/PostureLevel public IEnumerable <PostureLevel> Get() { string userId = User.Identity.GetUserId(); return(PostureLevelsService.GetUserPostureLevels(userId)); }