Exemplo n.º 1
0
        public OptionsCollectionById ConvertToOptionsCollectionById()
        {
            OptionsCollectionById options = new OptionsCollectionById();

            CopyOptions(options);
            options.TargetId = Id;
            return(options);
        }
Exemplo n.º 2
0
        public IEnumerable <Comment> GetCommentsWithTools(OptionsCollectionById options)
        {
            var comments = CacheRepository.GetItems <Comment>(GetOptionsString(options));

            if (comments != null)
            {
                return(comments);
            }

            comments = CommentRepository.GetWithOptions(options);
            CacheRepository.Add(comments, GetOptionsString(options));
            return(comments);
        }
Exemplo n.º 3
0
 private string GetOptionsString(OptionsCollectionById options)
 {
     return($"{CommentsByPostIdCache}-{options.TargetId}-{CommentsWithToolsCache}-{options.DateRange}-{options.SortType}-{options.Page}-{options.Search}");
 }