Contents
You are limited to no more than 10 $expand options in a query. This is to protect performance. Each $expand options creates a join that can impact performance. To retrieve related entities for an entity instance, see Retrieve related tables for a table by expanding navigation properties.
To retrieve related entities for an entity instance, see Retrieve related tables for a table by expanding navigation properties. Queries which expand collection-valued navigation properties may return cached data for those properties that doesn’t reflect recent changes.
How to retrieve a collection of related records?
If you want to retrieve the collection separately, you can use the value of the @odata.nextLink property with a new GET request to return the required data. The following example retrieves the tasks assigned to the top 2 account records. One has related tasks, the other does not.
How to retrieve related entity Records in Excel?
As explained earlier, expanding on collection-valued navigation properties to retrieve related entities for entity sets returns one level of depth and an @odata.nextLink property for the related entities. In this example, we are retrieving the contact and tasks assigned to the top 2 accounts.
If you expand on collection-valued navigation parameters to retrieve related entities for entity sets, only one level of depth is returned if there is data. Otherwise the collection will return an empty array.
Eager loading. When the entity is read, related data is retrieved along with it. This typically results in a single join query that retrieves all of the data that’s needed. You specify eager loading in Entity Framework Core by using the Include and ThenInclude methods.
How to return related entities in Microsoft Excel?
Instead of returning the related entities for entity sets, you can also return references (links) to the related entities by expanding the single-valued navigation property with the $ref option. The following example returns links to the contact records for all the accounts.