mirror of
https://github.com/valentincanonical/eShopOnWeb-chisel-demo.git
synced 2026-05-21 15:52:51 +00:00
30 lines
875 B
C#
30 lines
875 B
C#
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<IActionResult> 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();
|
|
}
|
|
}
|
|
}
|