How-To Convert IQueryable Expression Tree to Lambda
How can i conver开发者_运维百科t a IQueryable Expression
Tree to a Expression<Func<T,bool>>
Expression.
IQueryable<Book> Books;
var query = Books.Where(p => p.Author.AuthorId == 5);
Expression<Func<Book, bool>> expression = ?????
You use the IQueryable.Expression Property to access the IQueryable's Expression tree.
Expression<Func<Book, bool>> expression = p => p.Author.AuthorId == 5;
精彩评论