public int CreateComment(Comment comment) { int id = CommentRepository.Create(comment); UnitOfWork.Save(); CacheRepository.DeleteByPartOfTheKey($"{CommentsByPostIdCache}-{comment.NewsPostId}"); return(id); }
public void DeleteComment(int id, int newsPostId) { CommentRepository.Delete(id); UnitOfWork.Save(); CacheRepository.DeleteByPartOfTheKey($"{CommentsByPostIdCache}-{newsPostId}"); }