Esempio n. 1
0
        public async Task <IActionResult> ListByCategoryId(int id, int page = 1)
        {
            var pageSize = int.Parse(_configuration["PageSize"]);
            var category = await _categoryApiClient.GetCategoryById(id);

            var data = await _knowledgeBaseApiClient.GetKnowledgeBasesByCategoryId(id, page, pageSize);

            var viewModel = new ListByCategoryIdViewModel()
            {
                Data     = data,
                Category = category
            };

            return(View(viewModel));
        }
Esempio n. 2
0
        public async Task <IActionResult> Category(int id, string culture, int page = 1)
        {
            var product = await _productApiClient.GetProductPaging(new GetManageProductPagingRequest
            {
                CategoryId = id,
                LanguageId = culture,
                PageIndex  = page,
                PageSize   = 10
            });

            return(View(new CategoryProductViewModel
            {
                products = product.ResultObject,
                category = await _categoryApiClient.GetCategoryById(id, culture)
            }));
        }