Class LinqExtensions
- Assembly
- Stratara.EventSourcing.EntityFrameworkCore.dll
LINQ extensions that translate a property name supplied as a string into a typed
OrderBy / OrderByDescending projection — useful for dynamic sorting
driven by paged-query parameters.
public static class LinqExtensions
- Inheritance
-
LinqExtensions
- Inherited Members
Methods
OrderByDescending<T>(IQueryable<T>, string)
Orders the source descending by the property named propertyName.
public static IOrderedQueryable<T> OrderByDescending<T>(this IQueryable<T> source, string propertyName)
Parameters
sourceIQueryable<T>The source queryable.
propertyNamestringThe CLR property name to sort by.
Returns
- IOrderedQueryable<T>
The ordered queryable.
Type Parameters
TThe element type of the queryable.
OrderBy<T>(IQueryable<T>, string)
Orders the source ascending by the property named propertyName.
public static IOrderedQueryable<T> OrderBy<T>(this IQueryable<T> source, string propertyName)
Parameters
sourceIQueryable<T>The source queryable.
propertyNamestringThe CLR property name to sort by.
Returns
- IOrderedQueryable<T>
The ordered queryable.
Type Parameters
TThe element type of the queryable.