.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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -