Files
eShopOnWeb-chisel-demo/src/Web/Controllers/CatalogController.cs
Steve Smith 97ef1c79a0 Controller cleanup (#30)
* Cleaning up routes.

* Adding signout functionality

* Added simple checkout behavior
2017-08-07 14:12:48 -04:00

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();
}
}
}