public async Task <IActionResult> Index() { var categories = await this.categoryService.GetAllCategoriesAsync(); var output = new AllCategoriesAndSubCategoriesViewModell { Categories = categories.Select(x => new CategoryViewModel { Name = x.Name, ImgPath = x.ImgPath, }).ToList(), }; return(this.View(output)); }
public async Task <IActionResult> AllCategoriesAndSubCategories() { var categories = await this.categoryService.GetAllCategoriesWithDeletedAsync(); var output = new AllCategoriesAndSubCategoriesViewModell { Categories = categories.Select(x => new CategoryViewModel { Id = x.Id, Name = x.Name, IsDeleted = x.IsDeleted, }).ToList(), }; return(this.View(output)); }