Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@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
You can’t perform that action at this time.