Share via


EntityQueryable.OrderBy<TEntity, TKey> Method

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Applies the specified ascending order clause to the source query.

Namespace:  System.ServiceModel.DomainServices.Client
Assembly:  System.ServiceModel.DomainServices.Client (in System.ServiceModel.DomainServices.Client.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function OrderBy(Of TEntity As Entity, TKey) ( _
    source As EntityQuery(Of TEntity), _
    keySelector As Expression(Of Func(Of TEntity, TKey)) _
) As EntityQuery(Of TEntity)
'Usage
Dim source As EntityQuery(Of TEntity)
Dim keySelector As Expression(Of Func(Of TEntity, TKey))
Dim returnValue As EntityQuery(Of TEntity)

returnValue = source.OrderBy(keySelector)
public static EntityQuery<TEntity> OrderBy<TEntity, TKey>(
    this EntityQuery<TEntity> source,
    Expression<Func<TEntity, TKey>> keySelector
)
where TEntity : Entity
[ExtensionAttribute]
public:
generic<typename TEntity, typename TKey>
where TEntity : Entity
static EntityQuery<TEntity>^ OrderBy(
    EntityQuery<TEntity>^ source, 
    Expression<Func<TEntity, TKey>^>^ keySelector
)
static member OrderBy : 
        source:EntityQuery<'TEntity> * 
        keySelector:Expression<Func<'TEntity, 'TKey>> -> EntityQuery<'TEntity>  when 'TEntity : Entity
JScript does not support generic types and methods.

Type Parameters

  • TEntity
    The entity type being queried.
  • TKey
    The type of the member being ordered by.

Parameters

Return Value

Type: System.ServiceModel.DomainServices.Client.EntityQuery<TEntity>
The composed query.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type EntityQuery<TEntity>. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also

Reference

EntityQueryable Class

System.ServiceModel.DomainServices.Client Namespace