T
IdeaBlade DevForce 2010 Help Reference
ToQuery<T>(RelatedEntityList<T>) Method
See Also  Example Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityQueryExtensions Class > ToQuery Method : ToQuery<T>(RelatedEntityList<T>) Method



entities
Returns an EntityQuery which can be used to query for these entities.

Syntax

Visual Basic (Declaration) 
<ExtensionAttribute()>
Public Overloads Shared Function ToQuery(Of T As {Class, IEntity})( _
   ByVal entities As RelatedEntityList(Of T) _
) As EntityQuery(Of T)
Visual Basic (Usage)Copy Code
Dim entities As RelatedEntityList(Of T)
Dim value As EntityQuery(Of T)
 
value = EntityQueryExtensions.ToQuery(Of T)(entities)
C# 
[ExtensionAttribute()]
public static EntityQuery<T> ToQuery<T>( 
   RelatedEntityList<T> entities
)
where T: class, IEntity
C++/CLI 
[ExtensionAttribute()]
public:
static EntityQuery<T^>^ ToQuerygeneric<typename T>
( 
   RelatedEntityList<T^>^ entities
) 
where T: ref class, IEntity

Parameters

entities

Type Parameters

T

Example

C#Copy Code
var mgr = new DomainModelEntityManager();

var customer = mgr.Customers.FirstOrNullEntity();
var orders = customer.OrderSummaries;
var query = orders.ToQuery();

Remarks

The EntityQuery returned is built using the EntityKey of each entity in the list. If the list is empty, which it will be if the IsPendingEntityList flag is on, an exception is thrown.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.