Xml generic type deserialisation based on attribute
Hi there,
I'm working on a server for a client app which sends requests in a fixed xml format, it has a root node with a method attribute and depending on the method there are different objects serialised into the root node.
My question is, I want something which can deserialise to the root node object and then be casted later down the line to an object with the proper generic type. Said generic type will contain the correct xml model for the given method attribute.
Is there a way to do this with C# xml serialisation by default. I don't need any specific code and am fine with just docs/a writeup to research into just want to know if what I am wanting to do if possible and if not, possibly an alternative way to achieve it.
I cannot change how the client works unfortunately.
Hope this all makes sense.
0 Replies