@model IEnumerable<Anidopt.Models.Animal>

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

<h1>Index</h1>

<p>
    <a asp-action="Create">Create New</a>
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Id)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.BirthDay)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Breed.Species)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Breed)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Height)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Weight)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Sex)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Organisation)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Id)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.BirthDay)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Breed.Species.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Breed.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Height)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Weight)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Sex.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Organisation.Name)
                </td>
                <td>
                    <a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
                    <a asp-action="Details" asp-route-id="@item.Id">Details</a> |
                    <a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
                </td>
            </tr>
        }
    </tbody>
</table>
