質問

I know I can walk a linq expression tree and emit the IL code by myself. But i'm trying to avoid that. In this case, using the CodeDom or the Roslyn compiler is not an option (I have to start from an existing set of linq expressions generated by a propietary DSL). Any ideas? Thanks!

役に立ちましたか?

解決

You can compile an expression to an assembly by using CompileToMethod(). This has some restrictions, most notably that the MethodBuilder that you pass to the method has to be for a static method. But otherwise this should be exactly what you're asking for.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top