Consolidate Web and WebRazorPages Projects (#192)
* Moved Privacy, Home page to Razor Pages * Migrating Basket from RazorPages to Web. * Removed BasketController; refactored viewmodels * Moved BasketComponent into Pages/Shared Added auth rules to Startup for Pages Added notes to controllers about Pages usage. * Fixed broken my orders test Consolidated Functional Tests * Fixed logo link to home page Fixed Order Detail Total $ format
This commit is contained in:
26
src/Web/Pages/Index.cshtml.cs
Normal file
26
src/Web/Pages/Index.cshtml.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.eShopWeb.Web.Services;
|
||||
using Microsoft.eShopWeb.Web.ViewModels;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.eShopWeb.Web.Pages
|
||||
{
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
private readonly ICatalogService _catalogService;
|
||||
|
||||
public IndexModel(ICatalogService catalogService)
|
||||
{
|
||||
_catalogService = catalogService;
|
||||
}
|
||||
|
||||
public CatalogIndexViewModel CatalogModel { get; set; } = new CatalogIndexViewModel();
|
||||
|
||||
public async Task OnGet(CatalogIndexViewModel catalogModel, int? pageId)
|
||||
{
|
||||
CatalogModel = await _catalogService.GetCatalogItems(pageId ?? 0, Constants.ITEMS_PER_PAGE, catalogModel.BrandFilterApplied, catalogModel.TypesFilterApplied);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user