I'm receiving data from web-services in XML and I'm using that data via objects, build upon received XML. So, sometimes I need to store such user-specific objects between requests in session. I know that XMLDocument couldn't be stored explicitly (state server)... so I'm making a terrible construction like:
private string _data;
public XmlDocument Data
{
get
{
XmlDocument res = new XmlDocument();
if (!string.IsNullOrEmpty(_data))
{
res.InnerXml = _data;
return res;
}
return null;
}
set { _data = value.InnerXml; }
}
So i'm implicitly storing xml... it useful for me during development, because I don't know exactly what properties I need from entire object - I can make simple experimental properties with xpath etc in a pinch...
so it's comfortable fo me, but it looks very inefficient to construct xmldocument from string each time I need to get some data from any property of that class. Is there any way around?) thanks.