Given the classes:
class Base { }
class Derived : Base { public string Value { get; set; } }
With this XML:
<Derived><Value>something</Value></Derived>
Is there a way to create a serializer that can deserialize this only knowing the base class:
var serializer = new XmlSerializer(typeof(Base));
var b = (Base)serializer.Deserialize(stream);
I know how to deal with polymorphic sub elements but not the root element its self.
I feel like this question must have been asked before but I'm not finding the answer so a link to an answer would more than enough :)