You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GetCategories.cs 700B

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