Renaming Cart to Basket (#38)
This commit is contained in:
@@ -7,13 +7,13 @@ using Microsoft.eShopWeb.ViewModels;
|
||||
namespace Microsoft.eShopWeb.Controllers
|
||||
{
|
||||
[Route("[controller]/[action]")]
|
||||
public class CartController : Controller
|
||||
public class BasketController : Controller
|
||||
{
|
||||
private readonly IBasketService _basketService;
|
||||
private const string _basketSessionKey = "basketId";
|
||||
private readonly IUriComposer _uriComposer;
|
||||
|
||||
public CartController(IBasketService basketService,
|
||||
public BasketController(IBasketService basketService,
|
||||
IUriComposer uriComposer)
|
||||
{
|
||||
_basketService = basketService;
|
||||
@@ -28,9 +28,9 @@ namespace Microsoft.eShopWeb.Controllers
|
||||
return View(basketModel);
|
||||
}
|
||||
|
||||
// POST: /Cart/AddToCart
|
||||
// POST: /Basket/AddToBasket
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> AddToCart(CatalogItemViewModel productDetails)
|
||||
public async Task<IActionResult> AddToBasket(CatalogItemViewModel productDetails)
|
||||
{
|
||||
if (productDetails?.Id == null)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@using Microsoft.eShopWeb.ViewModels
|
||||
@{
|
||||
ViewData["Title"] = "Cart";
|
||||
ViewData["Title"] = "Basket";
|
||||
@model BasketViewModel
|
||||
}
|
||||
<section class="esh-catalog-hero">
|
||||
@@ -77,7 +77,7 @@
|
||||
else
|
||||
{
|
||||
<div class="esh-catalog-items row">
|
||||
Cart is empty.
|
||||
Basket is empty.
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -1,10 +1,10 @@
|
||||
@model CatalogItemViewModel
|
||||
|
||||
|
||||
<form asp-controller="Cart" asp-action="AddToCart">
|
||||
<form asp-controller="Basket" asp-action="AddToBasket">
|
||||
|
||||
<img class="esh-catalog-thumbnail" src="@Model.PictureUri" />
|
||||
<input class="esh-catalog-button" type="submit" value="[ ADD TO CART ]" />
|
||||
<input class="esh-catalog-button" type="submit" value="[ ADD TO BASKET ]" />
|
||||
|
||||
<div class="esh-catalog-name">
|
||||
<span>@Model.Name</span>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</a>
|
||||
</section>
|
||||
@await Html.PartialAsync("_LoginPartial")
|
||||
<section class="col-lg-1 col-xs-12"><a asp-controller="Cart" asp-action="Index">Cart</a></section>
|
||||
<section class="col-lg-1 col-xs-12"><a asp-controller="Basket" asp-action="Index">Basket</a></section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</section>
|
||||
|
||||
@*<section class="col-lg-1 col-xs-12">
|
||||
@await Component.InvokeAsync("Cart", new { user = UserManager.Parse(User) })
|
||||
@await Component.InvokeAsync("Basket", new { user = UserManager.Parse(User) })
|
||||
</section>*@
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user