i have a xml like this
I want to parse the xml, build a dynamic class with spscified properties. i found some pointers to do it with system.reflection.emit namespace, but i do i always have to create an assembly and module in order to define the type? can i just create a type and define the properties?
<Root> <type> <name>mytype</name> <properties> <property> <name>property1</name> <value>2</value> <datatype>int</datatype> </property> <property> <name>property3</name> <value>2.5</value> <datatype>double</datatype> </property> <property> <name>property4</name> <value>hello world</value> <datatype>string</datatype> </property> </properties> </type> </Root>
A type must always exist in an Assembly – so you’ll have to create the assembly in memory. You might find it a bit easier to use the CodeDom model to define the types.