I am trying to return XMLNodeReader to another function but getting CA2000 warning
XmlNodeReader obj =new XmlNodeReader(section);
return ser.method(obj);
If I use the following code, will it work properly? The warning is supressed but not sure if it will affect the logic or not.
XmlNodeReader tempObj =new XmlNodeReader(section);
XmlNodeReader retObj=null;
retObj = tempObj;
tempObj.Dispose();
return ser.method(retObj);