public void AddComment(Comment comment) { comment.CreatedBy = "rhandoo"; comment.CreatedDate = DateTime.Now; DbContext().Comment.Add(comment); DbContext().SaveChanges(); }
public HttpResponseMessage Add(CommentRequest commentRequest) { //check of article exists var article = _articleRepository.GetArticleById(commentRequest.ArticleId); var comment = new Comment { Id = commentId++, Text = commentRequest.Message, ArticleId = article.Id }; _articleRepository.AddComment(comment); return Request.CreateResponse(HttpStatusCode.OK); }
public CommentDto Build(Comment comment) { throw new NotImplementedException(); }