Class QuerySortExtensions
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Provides extension methods for sorting queryable data sources using sort definitions.
public static class QuerySortExtensions
- Inheritance
-
QuerySortExtensions
- Inherited Members
Remarks
This class contains methods that extend IQueryable<T> with sorting capabilities based on a collection of SortDefinition<T> instances. These extensions allow for dynamic and customizable sorting of data.
Methods
OrderBy<T>(IQueryable<T>, IEnumerable<SortDefinition<T>>)
Sorts the elements of a sequence in the order described by the sort definitions.
public static IQueryable<T> OrderBy<T>(this IQueryable<T> source, IEnumerable<SortDefinition<T>> sortDefinitions)
Parameters
source
IQueryable<T>A sequence of values to order.
sortDefinitions
IEnumerable<SortDefinition<T>>A collection of SortDefinition<T> that describe how to sort the source.
Returns
- IQueryable<T>
An IOrderedQueryable<T> whose elements are sorted according to the sort definitions or the
source
itself if the sort definitions are empty.
Type Parameters
T
The type of the elements of source
OrderBy<T>(IQueryable<T>, IEnumerable<SortDefinition<T>>, Func<ParameterExpression, SortDefinition<T>, Expression>)
Sorts the elements of a sequence in the order described by the sort definitions.
public static IQueryable<T> OrderBy<T>(this IQueryable<T> source, IEnumerable<SortDefinition<T>> sortDefinitions, Func<ParameterExpression, SortDefinition<T>, Expression> expression)
Parameters
source
IQueryable<T>A sequence of values to order.
sortDefinitions
IEnumerable<SortDefinition<T>>A collection of SortDefinition<T> that describe how to sort the source.
expression
Func<ParameterExpression, SortDefinition<T>, Expression>A function that constructs the body of the lambda expression for the given parameter expression and sort definition.
Returns
- IQueryable<T>
An IOrderedQueryable<T> whose elements are sorted according to the sort definitions or the
source
itself if the sort definitions are empty.
Type Parameters
T
The type of the elements of source