Esempio n. 1
0
        public async Task <IActionResult> Index()
        {
            var latestKbs = await _knowledgeBaseApiClient.GetLatestKnowledgeBases(6);

            var popularKbs = await _knowledgeBaseApiClient.GetPopularKnowledgeBases(6);

            var labels = await _labelApiClient.GetPopularLabels(20);

            var viewModel = new HomeViewModel()
            {
                LatestKnowledgeBases  = latestKbs,
                PopularKnowledgeBases = popularKbs,
                PopularLabels         = labels
            };

            return(View(viewModel));
        }
Esempio n. 2
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var categories = await _categoryApiClient.GetCategories();

            var popularKnowledgeBases = await _knowledgeBaseApiClient.GetPopularKnowledgeBases(4);

            var recentComments = await _knowledgeBaseApiClient.GetRecentComments(4);

            var viewModel = new SideBarViewModel()
            {
                Categories            = categories,
                PopularKnowledgeBases = popularKnowledgeBases,
                RecentComments        = recentComments
            };

            return(View("Default", viewModel));
        }