Share via


HpcLinqQueryable.AssumeOrderBy Method (IQueryable, Expression, Boolean)

Indicates to LINQ to HPC that the specified set of records is ordered according to the values obtained by applying the specified function to the records.

Namespace: Microsoft.Hpc.Linq
Assembly: Microsoft.Hpc.Linq (in Microsoft.Hpc.Linq.dll)

Usage

'Usage
Dim source As IQueryable(Of TSource)
Dim keySelector As Expression(Of Func(Of TSource, TKey))
Dim isDescending As Boolean
Dim returnValue As IQueryable(Of TSource)

returnValue = HpcLinqQueryable.AssumeOrderBy(source, keySelector, isDescending)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function AssumeOrderBy(Of TSource, TKey) ( _
    source As IQueryable(Of TSource), _
    keySelector As Expression(Of Func(Of TSource, TKey)), _
    isDescending As Boolean _
) As IQueryable(Of TSource)
[ExtensionAttribute] 
public static IQueryable<TSource> AssumeOrderBy<TSource,TKey> (
    IQueryable<TSource> source,
    Expression<Func<TSource,TKey>> keySelector,
    bool isDescending
)
[ExtensionAttribute] 
public:
generic<typename TSource, typename TKey>
static IQueryable<TSource>^ AssumeOrderBy (
    IQueryable<TSource>^ source, 
    Expression<Func<TSource, TKey>^>^ keySelector, 
    bool isDescending
)
J# supports the use of generic APIs, but not the declaration of new ones.
JScript does not support generic types or methods.

GenericParameters

  • TSource
    The type of the records in the source parameter.
  • TKey
    The return type of the function that you specify in the keySelector parameter to generate the key from a record.

Parameters

  • source
    A System.Linq.IQueryable<TSource> interface for the set of records that you want to designate as sorted.
  • isDescending
    A Boolean that indicates whether the records are sorted in ascending order or descending order. True indicates that the records are sorted in descending order. False indicates that the values are sorted in ascending order.

Return Value

The same IQueryable interface that you specified in the source parameter.

Exceptions

Exception type Condition
ArgumentNullException

The specified source or keySelector parameter is a null reference (Nothing in Visual Basic).

Remarks

A set of records is ordered if the set is range partitioned and each partition is ordered on the same key.

To specify that the records are ordered by using an IEqualityComparer interface that you specify to compare the records, use the AssumeOrderBy(Generic IQueryable,Generic Expression,Generic IComparer,Boolean) form of the method.

In Visual Basic and C#, you can call this method as an instance method on any object of type IQueryable<TSource>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

This method has at least one parameter of type Expression with a type argument that is one of the Func types. For these parameters, you can pass in a lambda expression and it compiles to an Expression.

Platform Note: This method was introduced in Windows HPC Server 2008 R2 with Service Pack 2 (SP2) and is not supported in previous versions.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP, Windows Vista, Windows 7, Windows 8, Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012

Target Platforms

Windows XP, Windows Vista, Windows 7, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, with HPC Pack Client Utilities

See Also

Reference

HpcLinqQueryable Class
HpcLinqQueryable Members
Microsoft.Hpc.Linq Namespace
AssumeOrderBy(Generic IQueryable,Generic Expression,Generic IComparer,Boolean)
OrderBy
OrderByDescending

Build Date:

2013-04-22