Created
April 21, 2017 06:38
-
-
Save davidsheardown/0a8f2c02874653850331ff5cd2173a5b to your computer and use it in GitHub Desktop.
c# Handy Helper to convert XML to a Dynamic/Expando Object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Uses NewtonSoft.Json | |
XDocument doc = XDocument.Parse(xmlData); //or XDocument.Load(path) | |
string jsonText = JsonConvert.SerializeXNode(doc); | |
dynamic dyn = JsonConvert.DeserializeObject<ExpandoObject>(jsonText); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment