I have the following XML file:
<?xml version="1.0" encoding="utf-8" ?>
<scripts>
<ScriptName>
<name>
"My Name"
</ScriptName>
<ScriptBody>
"body contents"
</ScriptBody>
</script>
</scripts>
And the following object:
public class DbScript
{
#region Constructors
public DbScript()
: this(string.Empty, string.Empty)
{
}
public DbScript(string name, string body)
{
ScriptName = name;
ScriptBody = body;
}
#endregion
#region Properties
/// <summary>
/// Script name
/// </summary>
public string ScriptName { get; set; }
/// <summary>
/// Script body
/// </summary>
public string ScriptBody { get; set; }
#endregion
}
What is the quickest way to populate the collection of DBScript object from the contents of the XML file? Should I look into serializers?
Thanks!