Search code examples
.netasp.netentity-frameworkentity

What is the syntax for including multiple navigation properties in Entity Framework?


I am querying an Entity(Applicant) which has multiple navigation properties, need to include two navigation properties (Worker and StatusType) in the include part of the query.

Tried including one property Worker as .include("Worker") this works, but when I use .include("Worker, StatusType") to get both the navigation properties the query fails with the message 'invalid include path'.

What is the syntax for including multiple navigation properties in Entity Framework?


Solution

  • Use

    Include("Worker").Include("StatusType")