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

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