I am looking at moving a website from ASP.NET Web Pages to MVC. I need to understand how i do mutliple joins using entity framework.
I currently have 3 database tables with a model for each.
- Property
- Rooms
- RoomType
The code below gets all the info from the rooms table for each property, but it just gives me a RoomTypeID
from the Rooms
table. What I need is to get the RoomType
from the RoomType
table using that ID.
@model manage.stayinflorida.co.uk.DataModels.Property_Info
@foreach (var item in Model.RoomInfoes)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.RoomTypeID)
</td>
<td>
@Html.DisplayFor(modelItem => item.RoomDescription)
</td>
</tr>
}