Class SortingQueryableExtensions
- Namespace
- Magicalizer.Data.Extensions
- Assembly
- Magicalizer.dll
Extensions of queries to apply sortings.
public static class SortingQueryableExtensions
- Inheritance
-
SortingQueryableExtensions
- Inherited Members
Methods
ApplySorting<TEntity>(IQueryable<TEntity>, IEnumerable<Sorting<TEntity>>?)
Applies sortings to the query, in their order.
public static IQueryable<TEntity> ApplySorting<TEntity>(this IQueryable<TEntity> query, IEnumerable<Sorting<TEntity>>? sortings) where TEntity : class, IEntity
Parameters
queryIQueryable<TEntity>Query to apply sortings to.
sortingsIEnumerable<Sorting<TEntity>>Sortings to apply.
Returns
- IQueryable<TEntity>
Sorted query.
Type Parameters
TEntityEntity type.
Exceptions
- InvalidSortingException
A property path doesn't point to a sortable (scalar) property of the entity.