Skip to main content
Table of Contents

Class LinqExtensions

Namespace
Stratara.EventSourcing.EntityFrameworkCore.Extensions
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

source IQueryable<T>

The source queryable.

propertyName string

The CLR property name to sort by.

Returns

IOrderedQueryable<T>

The ordered queryable.

Type Parameters

T

The 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

source IQueryable<T>

The source queryable.

propertyName string

The CLR property name to sort by.

Returns

IOrderedQueryable<T>

The ordered queryable.

Type Parameters

T

The element type of the queryable.