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)

Syntax

'Declaration
Public Function Expand(Of TTarget) ( _
    navigationPropertyAccessor As Expression(Of Func(Of TElement, TTarget)) _
) As DataServiceQuery(Of TElement)
'Usage
Dim instance As DataServiceQuery 
Dim navigationPropertyAccessor As Expression(Of Func(Of TElement, TTarget))
Dim returnValue As DataServiceQuery(Of TElement)

returnValue = instance.Expand(navigationPropertyAccessor)
public DataServiceQuery<TElement> Expand<TTarget>(
    Expression<Func<TElement, TTarget>> navigationPropertyAccessor
)
public:
generic<typename TTarget>
DataServiceQuery<TElement>^ Expand(
    Expression<Func<TElement, TTarget>^>^ navigationPropertyAccessor
)
member Expand : 
        navigationPropertyAccessor:Expression<Func<'TElement, 'TTarget>> -> DataServiceQuery<'TElement> 
JScript does not support generic types and methods.

Type Parameters

  • TTarget
    Target type of the last property on the expand path.

Parameters

Return Value

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

Remarks

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

See Also

Reference

DataServiceQuery<TElement> Class

Expand Overload

System.Data.Services.Client Namespace