public static XmlNode ViewFields
{
get
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("<ViewFields/>");
return doc.FirstChild;
}
}
Refactorings
No refactoring yet !
Ants
March 8, 2010, March 08, 2010 17:11, permalink
I think that there is some kind of design issue where you aren't retaining the parent XmlDocument object that you are instantiating on line 5. But if you really don't care about actively tracking the document, try this code below.
public static XmlElement ViewFields
{
get { return new XmlDocument().CreateElement("ViewFields"); }
}
Very simple piece of code which returns a specific XmlNode. Any changes are welcome