-
- @if (Model.CatalogItems.Any())
+ @if (Model.CatalogModel.CatalogItems.Any())
{
-
+
- @foreach (var catalogItem in Model.CatalogItems)
+ @foreach (var catalogItem in Model.CatalogModel.CatalogItems)
{
}
-
-
+
}
else
{
diff --git a/src/Web/Pages/Index.cshtml.cs b/src/Web/Pages/Index.cshtml.cs
new file mode 100644
index 0000000..7e32c30
--- /dev/null
+++ b/src/Web/Pages/Index.cshtml.cs
@@ -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);
+ }
+
+
+ }
+}
diff --git a/src/Web/Pages/Privacy.cshtml b/src/Web/Pages/Privacy.cshtml
new file mode 100644
index 0000000..46ba966
--- /dev/null
+++ b/src/Web/Pages/Privacy.cshtml
@@ -0,0 +1,8 @@
+@page
+@model PrivacyModel
+@{
+ ViewData["Title"] = "Privacy Policy";
+}
+
@ViewData["Title"]
+
+
Use this page to detail your site's privacy policy.
diff --git a/src/Web/Pages/Privacy.cshtml.cs b/src/Web/Pages/Privacy.cshtml.cs
new file mode 100644
index 0000000..b3f4e58
--- /dev/null
+++ b/src/Web/Pages/Privacy.cshtml.cs
@@ -0,0 +1,11 @@
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace Microsoft.eShopWeb.Web.Pages
+{
+ public class PrivacyModel : PageModel
+ {
+ public void OnGet()
+ {
+ }
+ }
+}
diff --git a/src/Web/ViewComponents/Basket.cs b/src/Web/Pages/Shared/Components/BasketComponent/Basket.cs
similarity index 88%
rename from src/Web/ViewComponents/Basket.cs
rename to src/Web/Pages/Shared/Components/BasketComponent/Basket.cs
index 9cfa0e1..f1155dd 100644
--- a/src/Web/ViewComponents/Basket.cs
+++ b/src/Web/Pages/Shared/Components/BasketComponent/Basket.cs
@@ -1,14 +1,13 @@
-using Microsoft.eShopWeb.Infrastructure.Identity;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.eShopWeb;
+using Microsoft.eShopWeb.Infrastructure.Identity;
using Microsoft.eShopWeb.Web.Interfaces;
+using Microsoft.eShopWeb.Web.Pages.Basket;
using Microsoft.eShopWeb.Web.ViewModels;
using System.Linq;
using System.Threading.Tasks;
-namespace Microsoft.eShopWeb.Web.ViewComponents
+namespace Microsoft.eShopWeb.Web.Pages.Shared.Components.BasketComponent
{
public class Basket : ViewComponent
{
diff --git a/src/Web/Pages/Shared/Components/BasketComponent/Default.cshtml b/src/Web/Pages/Shared/Components/BasketComponent/Default.cshtml
new file mode 100644
index 0000000..b2a53f6
--- /dev/null
+++ b/src/Web/Pages/Shared/Components/BasketComponent/Default.cshtml
@@ -0,0 +1,13 @@
+@model BasketComponentViewModel
+@{
+ ViewData["Title"] = "My Basket";
+}
+
+
+

+
+
+ @Model.ItemsCount
+
+
diff --git a/src/Web/Views/Catalog/_pagination.cshtml b/src/Web/Pages/Shared/_pagination.cshtml
similarity index 78%
rename from src/Web/Views/Catalog/_pagination.cshtml
rename to src/Web/Pages/Shared/_pagination.cshtml
index 6ba9f4f..ab5ecee 100644
--- a/src/Web/Views/Catalog/_pagination.cshtml
+++ b/src/Web/Pages/Shared/_pagination.cshtml
@@ -7,9 +7,7 @@
@@ -24,9 +22,7 @@
diff --git a/src/Web/Views/Catalog/_product.cshtml b/src/Web/Pages/Shared/_product.cshtml
similarity index 59%
rename from src/Web/Views/Catalog/_product.cshtml
rename to src/Web/Pages/Shared/_product.cshtml
index 2c1fcdb..d27d2e4 100644
--- a/src/Web/Views/Catalog/_product.cshtml
+++ b/src/Web/Pages/Shared/_product.cshtml
@@ -1,22 +1,14 @@
@model CatalogItemViewModel
-
-