public void AddComment(Comment comment) { comment.CommentedOn = DateTime.Now; this._repo.Add(comment); this._repo.SaveChanges(); }
//public IHttpActionResult Get(int id) //{ // var comment = _commentService.GetComment(id); // return Ok(comment); //} public IHttpActionResult Post(Comment comment) { comment.UserId = this.User.Identity.GetUserId(); _commentService.AddComment(comment); return Ok(comment); }