As a result of a stored procedure I get a SqlXml object, from which I can call CreateReader to get a standard XmlReader so as I can handle it in my dll.
In the business layer of the application, I have an XMySerializer that could read the xml and instantiate the business object.
However the XMySerializer.Deserialize function takes a System.IO.Stream as an input.
So, the question is how could I get a System.IO.Stream from a System.Xml.XmlReader ?
Counterwise would be easier…
I think there is no way, getting the stream, the XmlReader uses. The Workaround would be to use
XmlReader.ReadOuterXml()to get the whole XML as a string and put it in aMemoryStream.