static void Main(string[] args) { var xmlGenerator = new XmlGenerator(); var xPersonels = xmlGenerator.GetXml(); Console.WriteLine(xPersonels); var adapter = new XmlToJsonWrapper(xmlGenerator); adapter.ConvertToJson(); Console.ReadLine(); }
public void ConvertToJson() { var getXml = _xmLGenerator.GetXml().Element("BankPersonels").Elements("Personels").Select(s => new BankPersonel { Name = s.Attribute("Name").Value, Age = Convert.ToInt32(s.Attribute("Age").Value), City = s.Attribute("City").Value }); Console.WriteLine(new JsonGenerator(getXml).ConvertToJson()); }