Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model List<Post>
- @if(Model.Count==0)
- {
- <h1> No Posts</h1>
- }
- else
- {
- <h1> @Model.Count Posts</h1>
- <table class="table">
- <thead class="thead-dark">
- <tr>
- <th scope="col"> Id </th>
- <th scope="col">Title</th>
- <th scope="col">DEscription</th>
- <th scope="col">Created</th>
- <th colspan ="2">Manage</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var x in Model)
- {
- <tr>
- <th scope="row">@x.Id</th>
- <td>@x.Title</td>
- <td>@x.Description</td>
- <td>@x.CreatedAt</td>
- <td><a asp-action="Edit" asp-controller="Admin" asp-route-id="@x.Id">Edit</a></td>
- <td><a asp-action="Delete" asp-controller="Admin" asp-route-id="@x.Id">Delete</a></td>
- </tr>
- }
- </tbody>
- </table>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement