private PostListViewModel InitializePostListViewModel(QueryResultDto <PostDto, PostFilterDto> postsResult, List <List <ImageDto> > imagesResult) { return(new PostListViewModel { Posts = new StaticPagedList <PostDto>(postsResult.Items, postsResult.RequestedPageNumber ?? 1, PostsPageSize, (int)postsResult.TotalItemsCount), ImagesForPosts = imagesResult, HashtagIndices = postsResult.Items.Select(p => PostFacade.FindHashtagIndices(p.Text)).ToList(), PostFilter = postsResult.Filter, }); }