mirror of
https://github.com/valentincanonical/eShopOnWeb-chisel-demo.git
synced 2026-05-11 10:56:43 +00:00
- I believe this causes some confusion when people see "Service" in the Web project. We have another service in there named BasketViewModelService instead of BasketService anyways. Adding "ViewModel" to the name is a better representation of what the "services" in the Web project represent.
22 lines
807 B
C#
22 lines
807 B
C#
using Microsoft.eShopWeb.Web.Services;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Microsoft.eShopWeb.Web.Controllers.Api
|
|
{
|
|
public class CatalogController : BaseApiController
|
|
{
|
|
private readonly ICatalogViewModelService _catalogViewModelService;
|
|
|
|
public CatalogController(ICatalogViewModelService catalogViewModelService) => _catalogViewModelService = catalogViewModelService;
|
|
|
|
[HttpGet]
|
|
public async Task<IActionResult> List(int? brandFilterApplied, int? typesFilterApplied, int? page)
|
|
{
|
|
var itemsPage = 10;
|
|
var catalogModel = await _catalogViewModelService.GetCatalogItems(page ?? 0, itemsPage, brandFilterApplied, typesFilterApplied);
|
|
return Ok(catalogModel);
|
|
}
|
|
}
|
|
}
|