public void SaveComment(Comment comment)
        {
            if (comment.ID == 0)
            {
                comment.Created = DateTime.Now;
                _dbContext.Comments.Add(comment);

                if (SaveCommentEvent != null)
                    SaveCommentEvent(this, comment);
            }

            _dbContext.SaveChanges();
        }
示例#2
0
 public void SaveComment(Comment comment)
 {
     _repository.SaveComment(comment);
 }
 //event
 void SaveCommentEventFired(object sender, Comment comment)
 {
     // _dbContext.Comments.
 }
        public void DeleteComment(Comment comment)
        {
            _dbContext.Comments.Remove(comment);

            _dbContext.SaveChanges();
        }
示例#5
0
 void comments_AddCommentEvent(object sender, Comment comment)
 {
     throw new NotImplementedException();
 }