DevForce Help Reference
Include<T>(IEntityQuery<T>,Expression<Func<T,Object>>) Method
Example 


An EntityQuery
An expression returning the navigation property
Configures eager fetching for related entities in the specified query path.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Overloads Shared Function Include(Of T)( _
   ByVal query As IEntityQuery(Of T), _
   ByVal expr As Expression(Of Func(Of T,Object)) _
) As IEntityQuery(Of T)
'Usage
 
Dim query As IEntityQuery(Of T)
Dim expr As Expression(Of Func(Of T,Object))
Dim value As IEntityQuery(Of T)
 
value = EntityQueryExtensions.Include(Of T)(query, expr)

Parameters

query
An EntityQuery
expr
An expression returning the navigation property

Type Parameters

T

Return Value

A new IEntityQuery with the defined query path.
Example
// Query for some customers, and include their orders.
var query1 = mgr.Customers
  .Where(c => c.Country == "UK")
  .Include(c=> c.OrderSummaries);

foreach (Customer c in query1) {
  Console.WriteLine("order count = " + c.OrderSummaries.Count);
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityQueryExtensions Class
EntityQueryExtensions Members
Overload List

Send Feedback