Framework for .net Reflection.Emit simplification?
Is there a framework, that makes the use of of Reflection.Emit easier? Something I can tell: Give me a class with a string field and get,s开发者_C百科et accessors.
The code I find in Create a class type in code in .net c# is what I need, but it is somewhat cryptic. I think a library with a simplified interface would boost productivity.
I think you just described CodeDOM. Unfortunately, it doesn't really (IMO) make it easier - it just makes it... different.
Personally, I'd just use TypeBuilder
, ILGenerator
and encapsulate the common functionality I need, i.e.
PropertyBuilder CreateProperty(TypeBuilder type, string name, Type propertyType)
{...}
Meta-programming is rarely simple, but from that detail you get a very good understanding of what is actually happening.
Have a look at the CCI.
精彩评论