DevForce Help Reference
ThenBySelector<TSource> Method (EntityQueryExtensions)
Example 


Adds secondary sort criteria to a query.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Shared Function ThenBySelector(Of TSource)( _
   ByVal source As IEntityQuery(Of TSource), _
   ByVal selector As ISortSelector _
) As IEntityQuery(Of TSource)
'Usage
 
Dim source As IEntityQuery(Of TSource)
Dim selector As ISortSelector
Dim value As IEntityQuery(Of TSource)
 
value = EntityQueryExtensions.ThenBySelector(Of TSource)(source, selector)

Parameters

source
selector

Type Parameters

TSource

Return Value

A query containing the sort criteria
Remarks
Use this method along with the OrderBySelector(ITypedEntityQuery,ISortSelector) to add dynamically-created sort criteria to a query.
Example
public void ThenBySample1() {
  var mgr = new DomainModelEntityManager();
  var selector1 = new SortSelector(typeof(Customer), "Country");
  var selector2 = new SortSelector(typeof(Customer), "CompanyName");
  var results = mgr.Customers.OrderBySelector(selector1).ThenBySelector(selector2).ToList();
}
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

Send Feedback