Skip to content

Instantly share code, notes, and snippets.

@pwdonald
pwdonald / xml_deserializer
Created February 5, 2014 20:18
C# Xml Deserialize to Model
// XML DESERIALIZER
// Used for deserializing XML serialized by the default C# serializer into Models
// that match the XML structure.
public static T XmlDeserializeFromString<T>(string objectData)
{
return (T)XmlDeserializeFromString(objectData, typeof(T), typeof(T).Name);
}
public static object XmlDeserializeFromString(string objectData, Type type, string rootname)