Expression Trees + Generic Static Constructors

added by BobStrogg
4/27/2012 1:47:30 PM

0 Kicks, 88 Views

A great thing about .NET Expression Trees is you can compile them at runtime, and they’ll execute as fast as any .NET code. However, while building and compiling a tree is pretty quick, it’s best if you only need to do it once. Here's a way to do that with a generic class and static constructor.