using Karsha_Site.Application.Services.Common.Queries.GetCategory; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace EndPoint.Site.ViewComponents { public class GetCategories : ViewComponent { private readonly IGetCategoryService _getCategoryService; public GetCategories(IGetCategoryService getCategoryService) { _getCategoryService = getCategoryService; } public IViewComponentResult Invoke() { var categories = _getCategoryService.Execute(); return View(viewName: "GetCategories", categories.Data); } } }