Generating dynamic C# based on textual data into the runtime?

Posted by WeNeedAnswers on Stack Overflow See other posts from Stack Overflow or by WeNeedAnswers
Published on 2010-03-24T16:22:54Z Indexed on 2010/03/24 16:23 UTC
Read the original article Hit count: 229

Filed under:
|

Is there a quick and easy way to load textual C# into a program.

I would like to load the LINQ from the database as an Expression and run it against some data (SQL or Array/List don't mind).

I know I can do it using the C# CodeDom/ExpressionTree builder with Assembly Loading and Creating AppDomains, but this seems very long winded.

Is there an easier way. I thought with the advent of .net 3.5 that the ExpressionTree would come to my aid, but I now realise that I have to write a parser to use this. Maybe there is a new trick in 4.0?

Something along the lines of a dynamic languages Parse would be great.

Any suggestions greatly appreciated.

© Stack Overflow or respective owner

Related posts about c#3.0

Related posts about c#4.0