tags:

views:

98

answers:

1

I have functions that take SQL where clauses, and I'm wondering if there's 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 a string where clause? Like "AgencyID = 'idValue'"?

Thanks!

+3  A: 

You could turn the lambda function into an expression tree, and then traverse the tree to build your string.

Gordon Tisher
That looks like a really informative blog entry.
Robert Harvey
This set me on the right path - thanks!
Shane Fulmer