SupportsExpand
Determines whether navigation properties can be retrieved from the base entity set, which is more accurate. If this property is false, it prevents the provider from retrieving navigation properties.
Data Type
bool
Default Value
true
Remarks
This property determines whether navigation properties can be retrieved from the base entity set.
If you use the connection property NavigationPropertiesAsViews, you will create a new view for each relationship. If SupportsExpand is set to false, querying these relationships will not work. In this case, you will see an exception message.
For example, the following query does not work when SupportsExpand is false:
SELECT * FROM navigationView
However, the following query will work:
SELECT * FROM navigationView WHERE parentKey = 'some value'
When the connection property IncludeNavigationProperties is set to true and this property is enabled, foreign keys for each relationship in every table will be included. However, if SupportsExpand is false, this information will not be available, as expansion is necessary to retrieve the actual key values.
For more on navigation properties, see Data Model.
Working with Limited APIs
In OData, the $expand parameter is used to expand specified navigation properties when requesting data from a given entity set. In SQL, this makes it possible to execute a SELECT * to a navigation property view.
If $expand is not supported, a different request must be made to retrieve a navigation property, one that specifies the primary key of the base entity set. This API restriction is reflected in SQL: You will need to specify the base entity's primary key in the WHERE clause.
For example, consider two entities with a one-to-many relationship in the Northwind sample service, Categories and Products. In OData, the Products associated with a given Category could be represented as a navigation property on the base Category entity set. The provider models the Products navigation property as a Categories_Products view.
If $expand is not supported, use a query like the following for this view:
SELECT * FROM Categories_Products WHERE (Categories_CategoryID = 1)