Parse XML to dynamic object in C#
<? xml version="1.0" encoding="utf-8" ?> < contacts > < contact id = '1' > < firstName > Michael </ firstName > < lastName > Jordan </ lastName > < age > 40 </ age > < dob > 1965 </ dob > < salary > 100.35 </ salary > </ contact > < contact id = '2' > < firstName > Scottie </ firstName > < lastName > Pippen </ lastName > < age > 38 </ age > < dob > 1967 </ dob > < salary > 55.28 </ salary > </ contact > </ contacts > public class XmlToDynamic { public static void Parse(dynamic parent, XElement node) { if (node.HasElements) { if (node.Elements(node.Elements().First().Name.LocalName).Count() > 1) { //list var item = new ExpandoObject(); var list = new List<dynamic
I admire this article for the well-researched content and excellent wording. Read more info about Website Design Cost Ireland. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.
ReplyDeleteI admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. Read more info about web developers London
ReplyDeleteYour essay is fantastic. Here, you've given very insightful knowledge. Web Designer in Tampa The information you have provided us with is genuinely beneficial and significant. Thank you for providing this information.
ReplyDelete