Table of Contents

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

query IQueryable<TEntity>

Query to apply sortings to.

sortings IEnumerable<Sorting<TEntity>>

Sortings to apply.

Returns

IQueryable<TEntity>

Sorted query.

Type Parameters

TEntity

Entity type.

Exceptions

InvalidSortingException

A property path doesn't point to a sortable (scalar) property of the entity.