Exemple #1
0
        public PostListViewModel GetPostCategoryList(PostListRequest request)
        {
            var blog  = _dataProvider.GetBlog();
            var posts = _dataProvider.GetPostsByCategorySlug(blog.PostsPerPage, request.PageIndex, request.CategorySlug);

            return(new PostListViewModel
            {
                PageTitle = blog.Name + " - " + blog.Description,
                PageSize = blog.PostsPerPage,
                PageIndex = request.PageIndex,
                Posts = _mapper.Map <List <PostViewModel> >(posts.posts),
                TotalPosts = posts.totalPosts
            });
        }