public IPageOfItems <Post> GetPostsByFileType(PagingInfo pagingInfo, string typeName) { return(cache.GetItems <IPageOfItems <Post>, Post>( string.Format("GetPostsWithDrafts-FileType:{0}", typeName), pagingInfo.ToCachePartition(), () => pluginEngine.ProcessDisplayOfPosts(context, () => repository.GetPostsByFiles(pagingInfo, getFiles(typeName)).FillTags(tagService).FillComments(commentService)), p => p.GetDependencies() )); }
public IPageOfItems <Post> GetPostsWithDrafts(PagingInfo pagingInfo) { return(cache.GetItems <IPageOfItems <Post>, Post>( "GetPostsWithDrafts", pagingInfo.ToCachePartition(), () => pluginEngine.ProcessDisplayOfPosts(context, () => repository.GetPosts(pagingInfo, true).FillTags(tagService).FillComments(commentService)), p => p.GetDependencies() )); }
public IPageOfItems <Post> GetPostsWithDrafts(PagingInfo pagingInfo, Blog blog) { return(cache.GetItems <IPageOfItems <Post>, Post>( string.Format("GetPostsWithDrafts-{0}", blog.GetCacheItemKey()), pagingInfo.ToCachePartition(), () => pluginEngine.ProcessDisplayOfPosts(context, () => repository.GetPostsWithDrafts(pagingInfo, blog).FillTags(tagService).FillComments(commentService)), p => p.GetDependencies() )); }
public IPageOfItems <Post> GetPosts(PagingInfo pagingInfo, ArchiveData archive) { return(cache.GetItems <IPageOfItems <Post>, Post>( string.Format("GetPosts-Year:{0},Month:{1},Day:{2}", archive.Year, archive.Month, archive.Day), pagingInfo.ToCachePartition(), () => pluginEngine.ProcessDisplayOfPosts(context, () => repository.GetPostsByArchive(pagingInfo, archive.Year, archive.Month, archive.Day).FillTags(tagService).FillComments(commentService)), p => p.GetDependencies() )); }
public IPageOfItems <PostComment> GetComments(PagingInfo pagingInfo, Tag tag) { return(cache.GetItems <IPageOfItems <PostComment>, PostComment>( string.Format("GetComments-{0}", tag.GetCacheItemKey()), pagingInfo.ToCachePartition(), () => processDisplayOfComments(() => getComments(blogsCommentRepository.GetComments(pagingInfo, tag))), c => getCommentDependencies(c, tag) )); }
public IPageOfItems <PostComment> GetComments(PagingInfo pagingInfo, Post post, bool includeUnapproved) { return(cache.GetItems <IPageOfItems <PostComment>, PostComment>( string.Format("GetComments-{0},IncludeUnapproved:{1}", post, includeUnapproved), pagingInfo.ToCachePartition(), () => processDisplayOfComments(() => getComments(blogsCommentRepository.GetComments(pagingInfo, post, includeUnapproved))), c => getCommentDependencies(c, post) )); }
public IPageOfItems <PostComment> GetComments(PagingInfo pagingInfo, bool includePending, bool sortDescending) { return(cache.GetItems <IPageOfItems <PostComment>, PostComment>( string.Format("GetComments-IncludePending:{0},SortDescending{1}", includePending, sortDescending), pagingInfo.ToCachePartition(), () => processDisplayOfComments(() => getComments(blogsCommentRepository.GetComments(pagingInfo, includePending, sortDescending))), c => getCommentDependencies(c, new SiteSmall(context.Site.ID)) )); }
public IPageOfItems <ScheduleItem> GetScheduleItemsByFlag(PagingInfo pagingInfo, Event evnt, string flagName) { return (cache.GetItems <IPageOfItems <ScheduleItem>, ScheduleItem>( string.Format("GetScheduleItems-Event:{0},Flag:{1}", evnt.Name, flagName), pagingInfo.ToCachePartition(), () => repository.GetScheduleItemsByFlag(pagingInfo, evnt, flagName).FillTags(tagService), si => si.GetDependencies() )); }
public IPageOfItems<ISearchResult> GetSearchResults(PagingInfo pagingInfo, SearchCriteria criteria) { IPageOfItems<ISearchResult> searchResults = cache.GetItems<IPageOfItems<ISearchResult>, ISearchResult>( string.Format("GetPosts-SearchTerm:{0}", criteria.Term), pagingInfo.ToCachePartition(), () => repository.GetSearchResults(pagingInfo, criteria), null ); //if (context.RequestDataFormat.IsFeed()) // searchResults = searchResults.Since(context.RequestContext.HttpContext.Request.IfModifiedSince()); pluginEngine.ExecuteAll("UserSearched", new { context, criteria }); return searchResults; }
public IPageOfItems <Post> GetPosts(PagingInfo pagingInfo, Blog blog) { IPageOfItems <Post> posts = cache.GetItems <IPageOfItems <Post>, Post>( string.Format("GetPosts-{0}", blog.GetCacheItemKey()), pagingInfo.ToCachePartition(), () => pluginEngine.ProcessDisplayOfPosts(context, () => repository.GetPosts(pagingInfo, blog).FillTags(tagService).FillComments(commentService)), p => p.GetDependencies() ); if (context.RequestDataFormat.IsFeed()) { posts = posts.Since(p => p.Published.Value, context.HttpContext.Request.IfModifiedSince()); } return(posts); }
public IPageOfItems <Post> GetPosts(PagingInfo pagingInfo) { bool includeDrafts = context.RequestDataFormat == RequestDataFormat.Web && context.User.IsAuthenticated && context.User.IsInRole("Admin"); IPageOfItems <Post> posts = cache.GetItems <IPageOfItems <Post>, Post>( string.Format("GetPosts-IncludeDrafts:{0}", includeDrafts), pagingInfo.ToCachePartition(), () => pluginEngine.ProcessDisplayOfPosts(context, () => repository.GetPosts(pagingInfo, includeDrafts).FillTags(tagService).FillComments(commentService)), p => p.GetDependencies() ); if (!includeDrafts) { posts = posts.Since(p => p.Published.Value, context.HttpContext.Request.IfModifiedSince()); } return(posts); }