@model ThAmCo.Stock.Models.ViewModel.VendorProductIndexModel

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

<h1>Index</h1>

<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Products.FirstOrDefault().Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Products.FirstOrDefault().Description)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Products.FirstOrDefault().Price)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Products.FirstOrDefault().BrandName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Products.FirstOrDefault().CategoryName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Products.FirstOrDefault().InStock)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.Products)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Price)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.BrandName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CategoryName)
                </td>
                <td>
                    <a asp-action="OrderRequest" asp-route-id="@item.Id" asp-route-supplier="@Model.Vendor">Order</a>
                </td>



</tr>
        }
    </tbody>
</table>