Hi All
In this blog you will get to know some of the problems i have faced during my day to day work. and the solutiosn that i have used for those problems.
Wednesday, October 17, 2012
Getting deserialized object from the xml string
publicstatic T DeserializeFromXml<T>(string xml)
{
T result;
XmlSerializer ser = newXmlSerializer(typeof (T));
using (TextReader tr = newStringReader(xml))
{
result = (T) ser.Deserialize(tr);
}
return result;
}
No comments:
Post a Comment