Renaming CatalogServices to CatalogViewModelService
- 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.
This commit is contained in:
@@ -6,15 +6,15 @@ namespace Microsoft.eShopWeb.Web.Controllers.Api
|
||||
{
|
||||
public class CatalogController : BaseApiController
|
||||
{
|
||||
private readonly ICatalogService _catalogService;
|
||||
private readonly ICatalogViewModelService _catalogViewModelService;
|
||||
|
||||
public CatalogController(ICatalogService catalogService) => _catalogService = catalogService;
|
||||
public CatalogController(ICatalogViewModelService catalogViewModelService) => _catalogViewModelService = catalogViewModelService;
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> List(int? brandFilterApplied, int? typesFilterApplied, int? page)
|
||||
{
|
||||
var itemsPage = 10;
|
||||
var catalogModel = await _catalogService.GetCatalogItems(page ?? 0, itemsPage, brandFilterApplied, typesFilterApplied);
|
||||
var catalogModel = await _catalogViewModelService.GetCatalogItems(page ?? 0, itemsPage, brandFilterApplied, typesFilterApplied);
|
||||
return Ok(catalogModel);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user