public Commentsbody Post([FromBody] string value) { Commentsbody comment = new Commentsbody(); comment = db.commentsbody.Add(comment).Entity; db.SaveChanges(); return(comment); }
public Commentsbody Delete(int id) { Commentsbody commentsbody = db.commentsbody.Find(id); if (commentsbody == null) { return(null); } else { db.commentsbody.Remove(commentsbody); db.SaveChanges(); } return(commentsbody); }
public Commentsbody Put(int id, [FromBody] DateTime commentcreatedate, [FromBody] string commenttext) { Commentsbody commentsbody = db.commentsbody.Find(id); if (commentsbody == null) { return(null); } else { commentsbody.Commentcreatedate = commentcreatedate; commentsbody.Commenttext = commenttext; } return(commentsbody); }