ASP.NET MVC CRUD With Dapper (Micro ORM)
ASP.NET MVC CRUD With Dapper (Micro ORM)
- @model IEnumerable<DapperMvc.Models.Friend>
-
- @{
- ViewBag.Title = "Index";
- }
-
- <h2>Index</h2>
-
- <p>
- @Html.ActionLink("Create New", "Create")
- </p>
- <table class="table">
- <tr>
- <th>
- @Html.DisplayNameFor(model => model.FriendName)
- </th>
- <th>
- @Html.DisplayNameFor(model => model.City)
- </th>
- <th>
- @Html.DisplayNameFor(model => model.PhoneNumber)
- </th>
- <th></th>
- </tr>
-
- @foreach (var item in Model) {
- <tr>
- <td>
- @Html.DisplayFor(modelItem => item.FriendName)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.City)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.PhoneNumber)
- </td>
- <td>
- @Html.ActionLink("Edit", "Edit", new { id=item.FriendID }) |
- @Html.ActionLink("Details", "Details", new { id=item.FriendID }) |
- @Html.ActionLink("Delete", "Delete", new { id=item.FriendID })
- </td>
- </tr>
- }
-
- </table>
元ネタ
http://www.c-sharpcorner.com/article/asp-net-mvc-crud-with-dapper-micro-orm/
0 件のコメント:
コメントを投稿