Skip to content

Commit

Permalink
Renaming Cart to Basket (dotnet-architecture#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardalis authored Aug 15, 2017
1 parent 434da3f commit 3a95375
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/Web/Controllers/CartController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
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;
Expand All @@ -28,9 +28,9 @@ public async Task<IActionResult> Index()
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)
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@using Microsoft.eShopWeb.ViewModels
@{
ViewData["Title"] = "Cart";
ViewData["Title"] = "Basket";
@model BasketViewModel
}
<section class="esh-catalog-hero">
Expand Down Expand Up @@ -77,7 +77,7 @@
else
{
<div class="esh-catalog-items row">
Cart is empty.
Basket is empty.
</div>
}
</div>
4 changes: 2 additions & 2 deletions src/Web/Views/Catalog/_product.cshtml
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Views/Shared/_LoginPartial.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -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>*@

}
Expand Down

0 comments on commit 3a95375

Please sign in to comment.