0

ソート式の作成に問題があります。

Expression<Func<Products, bool>>クエリ式が既に含まれている型の式があります。クエリの順序付けを行いたいのですが、成功しませんでした。

以下では、CreateSortExpression メソッドにエラーがあります。

private Expression<Func<Products, bool>> CreateOrderQuery(Expression<Func<Products, bool>> condition, descriptorOrder item)
{        
    condition= condition.AndAlso(CreateSortExpression(item.PropertyName));        

    return condition;
}

private Expression<Func<Products, bool>> CreateSortExpression(string p)
{
    Expression<Func<Products, bool>> condition = products => 
          p.OrderBy(products.Options.price);

    return condition;
}

エラー メッセージ'System.Linq.Enumerable.OrderBy(System.Collections.Generic.IEnumerable, System.Func)' は、使用法から推測できません。型引数を明示的に指定してみてください。

これを経験した人はいますか?ありがとう。

4

1 に答える 1