Exemple #1
0
        public OptionsCollectionById ConvertToOptionsCollectionById()
        {
            OptionsCollectionById options = new OptionsCollectionById();

            CopyOptions(options);
            options.TargetId = Id;
            return(options);
        }
Exemple #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);
        }
Exemple #3
0
 private string GetOptionsString(OptionsCollectionById options)
 {
     return($"{CommentsByPostIdCache}-{options.TargetId}-{CommentsWithToolsCache}-{options.DateRange}-{options.SortType}-{options.Page}-{options.Search}");
 }