public IHttpActionResult updatePost(PostBindingModel aPost) { if (!ModelState.IsValid) return BadRequest(ModelState); // ApplicationDbContext db = new ApplicationDbContext(); return Ok(); }
public IHttpActionResult newPost(PostBindingModel newPost) { if (!ModelState.IsValid) { return BadRequest(ModelState); } var tempPost = new Models.Posts() { AspNetUser = PostsLogic.postContext.AspNetUsers.First(u => u.Id == User.Identity.GetUserId()), Content = newPost.Content, // PostDate = DateTime.Now, JsonPicture = newPost.JsonPicture }; PostsLogic.postContext.Posts.InsertOnSubmit(tempPost); PostsLogic.postContext.SubmitChanges(); return Ok(); }