示例#1
0
        public int CreateComment(Comment comment)
        {
            int id = CommentRepository.Create(comment);

            UnitOfWork.Save();
            CacheRepository.DeleteByPartOfTheKey($"{CommentsByPostIdCache}-{comment.NewsPostId}");
            return(id);
        }
示例#2
0
 public void DeleteComment(int id, int newsPostId)
 {
     CommentRepository.Delete(id);
     UnitOfWork.Save();
     CacheRepository.DeleteByPartOfTheKey($"{CommentsByPostIdCache}-{newsPostId}");
 }