Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created February 22, 2018 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/c1634ee019133982e75877ed7f607cf2 to your computer and use it in GitHub Desktop.
Save dcomartin/c1634ee019133982e75877ed7f607cf2 to your computer and use it in GitHub Desktop.
@model AspNetCore.Demo.ShoppingCartViewModel
<h1>Shopping Cart</h1>
<div class="basket-content">
@foreach (var item in Model.Products)
{
<div class="basket-item">
<div class="basket-item-product">
<!-- IUrlHelper -->
<a href="@Url.Action("Product", "Products", new { item.Id })">
@item.Product
</a>
<!-- Tag Helper -->
<a asp-controller="Products" asp-action="Action"
asp-route-id="@item.Id">@item.Product</a>
</div>
<div class="basket-item-colour">@item.Colour</div>
<div class="basket-item-size">@item.Size</div>
<div class="basket-item-price">@item.Price</div>
</div>
}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment