Skip to content

Instantly share code, notes, and snippets.

@A2H111
Created December 29, 2017 23:58
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 A2H111/64d030492f33d870f71d7b21da862cda to your computer and use it in GitHub Desktop.
Save A2H111/64d030492f33d870f71d7b21da862cda to your computer and use it in GitHub Desktop.
@model IEnumerable<AspNetCoreMVCMongoDBDemo.Models.Customer>
@{
ViewData["Title"] = "Index";
}
<h2>Index</h2>
<p>
<a asp-action="Create">Create New</a>
</p>
<table class="table table-bordered" style="width:600px">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.CustomerId)
</th>
<th>
@Html.DisplayNameFor(model => model.CustomerName)
</th>
<th>
@Html.DisplayNameFor(model => model.Address)
</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.CustomerId)
</td>
<td>
@Html.DisplayFor(modelItem => item.CustomerName)
</td>
<td>
@Html.DisplayFor(modelItem => item.Address)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.CustomerId }) |
@Html.ActionLink("Details", "Details", new { id = item.CustomerId }) |
@Html.ActionLink("Delete", "Delete", new { id = item.CustomerId })
</td>
</tr>
}
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment