@model ThAmCo.Products.Models.ViewModels.DetailsWithReviewsModelcs

@{
    ViewData["Title"] = "Product Details";
}

<h1>Details</h1>

<div>
    <h4>Product</h4>
    <hr />
    <dl class="row">
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.Product.Name)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.Product.Name)
        </dd>
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.Product.Description)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.Product.Description)
        </dd>
    </dl>
</div>
<div><h3>Reviews</h3></div><br />
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Reviews.FirstOrDefault().Content)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Reviews.FirstOrDefault().Rating)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.Reviews)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Content)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Rating)
                </td>
            </tr>
        }
    </tbody>
</table>
<div>
    <a asp-action="Index">Back to List</a>
</div>
