Exemplo n.º 1
0
        public int CreateComment(Comment comment)
        {
            int id = CommentRepository.Create(comment);

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