Security Scan Warnings in Visual Studio are shown during the build. Currently, I am working on these warnings to get removed. I tried several MSDN sites but no luck. I have also read OWSAP but they are not clearly related to C#.
Code:
public static class XMLUtility
{
public static T DeserializeXML<T>(this string xmlString)
{
T returnValue = default(T);
if (string.IsNullOrEmpty(xmlString))
return returnValue;
XmlSerializer serial = new XmlSerializer(typeof(T));
StringReader reader = new StringReader(xmlString);
object result = serial.Deserialize(reader);
if (result != null && result is T)
{
returnValue = ((T)result);
}
return returnValue;
}
}