Serializing and Deserializing Expression Trees in C#

c# expression-trees serialization

Question

Is there a way to Deserialize Expressions in C#, I would like to store Expressions in a Database and load them at run time.

Accepted Answer

I continued work on the library that was mentioned by Serializing and Deserializing Expression Trees in C#

It looks like the project was abandoned (2008) but I did some work on it and now it works with .NET 4.0 and Silverlight. I made bug fixes to their code and also made it more DAL-independent.

http://expressiontree.codeplex.com/


Expert Answer

Not in full; however, the Dynamic LINQ sample may help a bit. You can certainly serialize an expression to a string (to an extent - generics look a bit screwy), but there is no inbuilt parser.




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why