@using WebApplication1.Models
@model IEnumerable<newsModel>


@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            title
        </th>
        <th>
            category
        </th>
        <th>
            tag
        </th>
        <th>
            publish date
        </th>
        <th>
            publisher
        </th>
        <th>
            Views
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.category)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.tag)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.date)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DisplayName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.views)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.NewsID }) |
                @Html.ActionLink("Details", "Details", new { id = item.NewsID }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.NewsID })
            </td>
        </tr>
    }

</table>
