How to convert a String to its equivalent LINQ Expression Tree?

Would the dynamic linq library help here? In particular, I’m thinking as a Where clause. If necessary, put it inside a list/array just to call .Where(string) on it! i.e.

var people = new List<Person> { person };
int match = people.Where(filter).Any();

If not, writing a parser (using Expression under the hood) isn’t hugely taxing – I wrote one similar (although I don’t think I have the source) in my train commute just before xmas…

Leave a Comment