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
That was some great resource that proved beneficial to me to understand some functional programming aspects. At first it looks hard to deal with but later on it was quite simple to get into it.
ReplyDeleteYou might also like this: http://www.itdevspace.com/2011/05/c-functional-programming.html Lots of examples how to use build in linq methods and how to write your own.
ReplyDeleteIt's very effective and helpful to learn about the basic concept of functional programming. For any novice learner, it will be very useful to various aspects of functional programming languages. Through such kinds of programming functions, we have developed a restaurant management software namely Bhojon. Please check out this link to learn more details: https://www.bdtask.com/restaurant-management-system.php
ReplyDelete