예제 #1
0
        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));
        }
예제 #2
0
        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));
        }