DevForce Help Reference
ToQuery<T>(T) Method
Example 


Returns an EntityQuery which can be used to query for this entity.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Overloads Shared Function ToQuery(Of T As {Class, IEntity})( _
   ByVal entity As T _
) As EntityQuery(Of T)
'Usage
 
Dim entity As T
Dim value As EntityQuery(Of T)
 
value = EntityQueryExtensions.ToQuery(Of T)(entity)
[Extension()]
public static EntityQuery<T> ToQuery<T>( 
   T entity
)
where T: class, IEntity

Parameters

entity

Type Parameters

T
Example
var mgr = new DomainModelEntityManager();

var customers = mgr.Customers.ToList();
var aCust = customers.First();
// Build a query to retrieve this customer
var query = aCust.ToQuery();
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