using Microsoft.eShopWeb.Services; using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; namespace Microsoft.eShopWeb.Controllers { [Route("")] public class CatalogController : Controller { private readonly ICatalogService _catalogService; public CatalogController(ICatalogService catalogService) => _catalogService = catalogService; [HttpGet] [HttpPost] public async Task Index(int? brandFilterApplied, int? typesFilterApplied, int? page) { var itemsPage = 10; var catalogModel = await _catalogService.GetCatalogItems(page ?? 0, itemsPage, brandFilterApplied, typesFilterApplied); return View(catalogModel); } [HttpGet("Error")] public IActionResult Error() { return View(); } } }