How to convert IQueryable expression tree to Lambda

How to convert a tree IQueryable Expressionto an expression Expression<Func<T,bool>>.

IQueryable<Book> Books;

var query = Books.Where(p => p.Author.AuthorId == 5);

Expression<Func<Book, bool>> expression = ?????
+3
source share
2 answers

You are using the IQueryable.Expression property to access the IQueryable expression tree.

+3
source
Expression<Func<Book, bool>> expression = p => p.Author.AuthorId == 5;
+2
source

Source: https://habr.com/ru/post/1749725/


All Articles