views:

28

answers:

1

I'm looking into generating types dynamically, ie. TypeBuilder, Reflection.Emit.. Is it ever possible to get design-time code completion for such created types? i.e typename recognition, list of properties after typing "obj1." and such.

Full Context: Trying to generate entities and data access objects corresponding to database tables in runtime. Code generation is an option, but I wanted to see if I could do without it. Have some experience in reflection, but none in type building the reflection.emit way.

+1  A: 

Not likely without some serious designer mojo. Emitted code isn't actually generated until runtime, which means it's not actually available at design time. You could use T4 templates to generate your types that way, as the designer will evaluate the templates to build the required types, which of course are immediately available at design time.

Matthew Abbott
Thanks, I will try that.
henginy