score:1

take a look at this blog entry.

basically, you're looking to do a "partial evaluation" of the expression to account for the value introduced by the closure. this msdn walkthrough (under the heading "adding the expression evaluator") has the code that is referenced by the blog entry for incorporating the unevaluated closure members in the resulting string.

now, it may not work with complex expressions, but it looks like it will get you on your way. just keep in mind that it doesn't normalize expressions. that is x => x.name == "erik" is functionally equivalent to x => "erik" == x.name (and all other variants).


Related Query

More Query from same tag