public ActionResult AddComment(CommentPostData postData) { if (!ModelState.IsValid) { //display error } if (!DB.Exists<Meeting>(postData.MeetingId)) { throw new HttpException(500, "meeting-not-found"); } var comment = new Comment { MeetingId = postData.MeetingId, Content = postData.Comment, CreatedAt = DateTime.Now, MemberHandle = postData.MemberHandle }; DB.Insert(comment); return Redirect(Url.Action("details", "meetings", new { id = postData.MeetingId })); }
public void OnAddComment(CommentAddedEvent @event) { var comment = new Comment(this, @event.MemberHandle, @event.Comment, @event.CreatedAt); _comments.Add(comment); }