This problem occurs when an entity's related table isn't selected in the controller and passed to the view. This can be done with the .include() method in LINQ.
The .Include() method tells Entity Framework to eagerly load the Category navigation property along with the Contact entity. In other words, it instructs Entity Framework to retrieve the associated Category for each Contact in the query result.
Ещё видео!