Example #1
0
 public void Put(int id, int boardId, [FromBody] Post post)
 {
     post.EditDate         = DateTime.Now;
     post.PostId           = id; //double checking id of the form body is the correct id
     post.BoardId          = boardId;
     _db.Entry(post).State = EntityState.Modified;
     _db.SaveChanges();
 }
 public void Put(int id, int postId, [FromBody] Comment comment)
 {
     comment.EditDate         = DateTime.Now;
     comment.CommentId        = id;
     comment.PostId           = postId;
     _db.Entry(comment).State = EntityState.Modified;
     _db.SaveChanges();
 }
 public void Put(int id, [FromBody] Board board)
 {
     board.BoardId          = id;
     _db.Entry(board).State = EntityState.Modified;
     _db.SaveChanges();
 }