@model PackageIndexViewModel

@{
    ViewData["Title"] = "Index";
}

<h2>Index</h2>

<p>
    <form method="get">
        <div asp-validation-summary="ModelOnly" class="text-danger"></div>
        
        <div class="form-group">
            <label asp-for="Query" class="control-label"></label>
            <input asp-for="Query" class="form-control" />
            <label asp-for="TotalHits" class="control-label"></label>
        </div>
        <div class="form-group">
            <input type="submit" value="Find" class="btn btn-default" />
        </div>
    </form>
</p>

<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Data[0].Id)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Data[0].Description)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model.Data) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Id)
              
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Description)
            </td>
            <td>
                @Html.ActionLink("Details", "Details", new { pkgid = item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { pkgid = item.Id })
            </td>
        </tr>
}
    </tbody>
</table>
