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