如何将IQueryable Expression
树转换为Expression<Func<T,bool>>
表达式。
IQueryable<Book> Books;
var query = Books.Where(p => p.Author.AuthorId == 5);
Expression<Func<Book, bool>> expression = ?????
答案 0 :(得分:3)
您使用IQueryable.Expression属性访问 IQueryable 的表达式树。
答案 1 :(得分:2)
Expression<Func<Book, bool>> expression = p => p.Author.AuthorId == 5;