QueryExtensions.SortBy<T>(IQueryable<T>, String) Method

Definition

Specifies a sort order.

C#
public static System.Linq.IQueryable<T> SortBy<T>(this System.Linq.IQueryable<T> source, string sortExpression) where T : class;

Type Parameters

T

The generic type of the object.

Parameters

source
IQueryable<T>

The object to sort.

sortExpression
String

The sort expression.

Returns

The sorted version of the source object.

Applies to

Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1