c# - Is it possible to auto-generate object initialization code from a runtime object with values? -
maybe long shot, if existed save me time.
to explain in more detail. let's have long xml file , mapped class. want test stuff , change values around before run test. re-construct whole xml structure writing c# code initializing mapped class, want know - absolutely have ?
so want parse big xml file object @ runtime , generate initialization code string paste somewhere. let's input :
<myobject> <prop1>a</prop1> <prop2>b</prop2> <prop2>c</prop2> </myobject>
and string example:
"new myobject() { prop1 = "a", prop2 = "b", prop3 = "c" }"
Comments
Post a Comment