How To Create A Linq Expression Dynamically?
I'm trying to figure out a way to create Linq Expressions dynamically. As I 开发者_开发百科understand them, these expressions are one of the new meta-programming features in introduced into .NET I'm thinking that to dynamically create these expressions I could do it from a string value, but there is also mention of being able to do this at runtime. An example in VB.NET or C# would be great.
You can do this using the Expression
class. See http://community.bartdesmet.net/blogs/bart/archive/2006/11/22/Getting-started-with-C_2300_-3.0-Expression-Trees.aspx for an explanation and references to more articles on how to accomplish this.
精彩评论