So far, System.Reflection.Emit allows you to generate code, which is the oldest of the code APIs in the .NET platform, and requires an understanding of IL. Expression trees introduced in .NET 3.5 and extended in .NET 4.0 (cannot create new types), but they can be used to build complete method bodies.
source share