Skip to content

Sorting by JsonElement property #7767

Closed Answered by AdamLawrenceDesign
AdamLawrenceDesign asked this question in Q&A
Discussion options

You must be logged in to vote

Figured out an implementation that worked for me, I needed create some operation handlers and enqueue them on the context.

Concrete that can later be enqueued

public sealed class AscendingSortOperation(Expression selector, ParameterExpression parameterExpression)
    : QueryableSortOperation(selector, parameterExpression)
{
    public override Expression CompileOrderBy(Expression expression) =>
        Expression.Call(
            expression.GetEnumerableKind(),
            nameof(Queryable.OrderBy),
            [ParameterExpression.Type, Selector.Type,],
            expression,
            Expression.Lambda(Selector, ParameterExpression));

    public override Expression CompileThenBy(Ex…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AdamLawrenceDesign
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant