Ejemplo n.º 1
0
        public virtual PartialViewResult RecentPostsList()
        {
            var model = new RecentPostsListViewModel();

            model.BlogPosts = BlogPostHelper.GetRecentPosts(5);
            return(PartialView(model));
        }
Ejemplo n.º 2
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var posts = await this.postService.GetRecentAsync <RecentPostsViewModel>();

            var model = new RecentPostsListViewModel()
            {
                Posts = posts
            };

            return(this.View(model));
        }