Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627
  1. using Karsha_Site.Application.Services.Common.Queries.GetCategory;
  2. using Microsoft.AspNetCore.Mvc;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. namespace EndPoint.Site.ViewComponents
  8. {
  9. public class GetCategories : ViewComponent
  10. {
  11. private readonly IGetCategoryService _getCategoryService;
  12. public GetCategories(IGetCategoryService getCategoryService)
  13. {
  14. _getCategoryService = getCategoryService;
  15. }
  16. public IViewComponentResult Invoke()
  17. {
  18. var categories = _getCategoryService.Execute();
  19. return View(viewName: "GetCategories", categories.Data);
  20. }
  21. }
  22. }