InvalidOperationException: No method 'Where' on type 'System.Linq.Queryable' is compatible with the supplied arguments

后端 未结 2 1357
無奈伤痛
無奈伤痛 2021-01-19 05:11

(Code below has been updated and worked properly)

There is dynamic OrderBy sample from LinqPad. What I want to do is just simply apply \'Where\' rather than \'OrderB

2条回答
  •  没有蜡笔的小新
    2021-01-19 06:01

    Your lambda expression creation looks odd to me. You're adding another parameter for no obvious reason. You're also using Predicate instead of Func. Try this:

    LambdaExpression lambda = Expression.Lambda>(
                        Expression.GreaterThan(member, Expression.Constant(100)), 
                        purchaseParam);
    

提交回复
热议问题