public IActionResult Index()
        {
            List <Category> categories = subCategoryService.GetCategories().ToList();

            return(View(new IndexViewModel()
            {
                CategorySelectListItems = Dropdown.From(categories)
            }));
        }
Esempio n. 2
0
        public async Task <IViewComponentResult> InvokeAsync(int CategoryId)
        {
            List <Category> categories = subCategoryService.GetCategories().ToList();

            return(View(ViewComponentPath.ViewPath("SubCategory", "_SubCategoryTable"), new SubCategoriesTableViewModel
            {
                CategorySelectListItems = Dropdown.From(categories),
                CategoryId = CategoryId,
                SubCategories = subCategoryService.GetSubcategoriesByCategoryID(CategoryId).ToList()
            }));
        }