DataServiceQuery<TElement>.Expand<TTarget> Method (Expression<Func<TElement, TTarget>>)

Expands a query to include entities from a related entity set in the query response, where the related entity is of a specific type in a type hierarchy.

Namespace:  System.Data.Services.Client
Assembly:  Microsoft.Data.Services.Client (in Microsoft.Data.Services.Client.dll)

public DataServiceQuery<TElement> Expand<TTarget>(
	Expression<Func<TElement, TTarget>> navigationPropertyAccessor
)

Type Parameters

TTarget

Target type of the last property on the expand path.

Parameters

navigationPropertyAccessor
Type: System.Linq.Expressions.Expression<Func<TElement, TTarget>>
A lambda expression that indicates the navigation property that returns the entity set to include in the expanded query.

Return Value

Type: System.Data.Services.Client.DataServiceQuery<TElement>
Returns a DataServiceQuery<TElement> that with the expand option included.

The Expand``2(ExpressionFuncUMP, UMP) method creates a new DataServiceQuery<TElement> with the expand option set in the URI generated by the returned query.

Use this method to include an entity set where the navigation property is on a derived type. When the related entity set is not in a type hierarchy, use the Expand(String) method

Show: