コード例 #1
0
        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);
 }
コード例 #3
0
 //event
 void SaveCommentEventFired(object sender, Comment comment)
 {
     // _dbContext.Comments.
 }
コード例 #4
0
        public void DeleteComment(Comment comment)
        {
            _dbContext.Comments.Remove(comment);

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