Query paths can be used with Entity SQL and LINQ queries.
Paths are all-inclusive. For example, if an include call indicates Include("Orders.OrderLines"), not only will OrderLines be included, but also Orders. For more information, see Shaping Query Results (Entity Framework).
When you call the Include method, the query path is only valid on the returned instance of the ObjectQuery<(Of <(T>)>). Other instances of ObjectQuery<(Of <(T>)>) and the object context itself are not affected.
Because the Include method returns the query object, you can call this method multiple times on an ObjectQuery<(Of <(T>)>) to specify multiple paths for the query, as in the following example:
' Create a SalesOrderHeader query with two query paths,
' one that returns order items and a second that returns the
' billing and shipping addresses for each order.
Dim query As ObjectQuery(Of SalesOrderHeader) = _
context.SalesOrderHeader.Include("SalesOrderDetail").Include("Address")
// Create a SalesOrderHeader query with two query paths,
// one that returns order items and a second that returns the
// billing and shipping addresses for each order.
ObjectQuery<SalesOrderHeader> query =
context.SalesOrderHeader.Include("SalesOrderDetail").Include("Address");