Creating a string from a lambda expression

I have functions that take SQL where clauses, and I wonder if there is a way to make them all strongly typed. Is there a way to take a lambda expression like a => a.AgencyID == id and convert it to where where where? How is "AgencyID =" idValue "??

Thanks!

+4
source share
1 answer

You can turn a lambda function into an expression tree and then cross the tree to build your string.

+3
source

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


All Articles