DevForce Help Reference
ThenBy(ISortSelector,String,ListSortDirection) Method
Example 


Returns a CompositeSortSelector with a "ThenBy" class added to the current selector.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Overloads Shared Function ThenBy( _
   ByVal selector As ISortSelector, _
   ByVal propertyPath As String, _
   Optional ByVal sortDirection As ListSortDirection _
) As CompositeSortSelector
'Usage
 
Dim selector As ISortSelector
Dim propertyPath As String
Dim sortDirection As ListSortDirection
Dim value As CompositeSortSelector
 
value = DynamicQueryExtensions.ThenBy(selector, propertyPath, sortDirection)

Parameters

selector
propertyPath
sortDirection
Example
public void DynamicQueryOrder() {
  var entityType = typeof(Product);
  var baseQuery = EntityQuery.Create(entityType);
  var pd = new PredicateDescription("UnitPrice", FilterOperator.IsGreaterThanOrEqualTo, 24);
  var ps = new SortSelector("Category.Name").ThenBy("PropertyName");
  var query = baseQuery.Where(pd).OrderBySelector(ps);
  var results = manager.ExecuteQuery(query);
}
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

DynamicQueryExtensions Class
DynamicQueryExtensions Members
Overload List

Send Feedback