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