@model LearnMVC.Models.IndexViewModel
ViewData["Title"] = "Index";
<a asp-action="Create">Create New</a>
@{ foreach (var title in Model.Titles)
var products = Model.Products.Where(x => x.Product == title);
foreach (var product in products)
@Html.DisplayNameFor(model => product.Date)
@Html.DisplayNameFor(model => product.Field1)
@Html.DisplayNameFor(model => product.Field2)
@Html.DisplayNameFor(model => product.Product)
@foreach (var item in product)
@Html.DisplayFor(modelItem => item.Date)
@Html.DisplayFor(modelItem => item.Field1)
@Html.DisplayFor(modelItem => item.Field2)
@Html.DisplayFor(modelItem => item.Product)
<a asp-action="Edit" asp-route-id="@item.ID">Edit</a> |
<a asp-action="Details" asp-route-id="@item.ID">Details</a> |
<a asp-action="Delete" asp-route-id="@item.ID">Delete</a>