.net - How to make property value serialize nested into element named after property? -
i want able serialize
class { base prop{ get; set; } } class b:base { [xmltext] string foo {get;set; } class c:base { [xmltext] string bar {get;set; }
to
<a> <prop> <b>blah</b> </prop> </a>
however, default behavior gives me
<a> <prop xsi:type="b">blah</prop> </a>
so basically, want discriminate type of property's value nesting element instead of using xsi:type.
is possible xml serialization attributes, or have resort ixmlserializable?
Comments
Post a Comment