for instance something like:
<apple />
will serialize just fine to a class called “apple”. however, if I want to call that class “Dragon” it will not serialize (which makes sense). I want to know how to mark up “Dragon” such that when the XmlSerializer sees it, it knows that “Dragon” is the same as
Assuming
Dragondefines at least a superset of the properties and fields thatappledoes then competent_tech’s answer is appropriate though I think your question is actually asking about:If
Dragonis not compatible withapplethen you may be better off performing an explicit conversion between the types. Assuming your application knows the definition of bothappleandDragon, this can be accomplished by deserializing yourapplestream to anappleobject, mapping the properties to a newDragonobject, and then serializing yourDragonobject.