static void XmlToCSVSample1() { using (var parser = new ChoXmlReader("sample.xml").WithXPath("Attributes/Attribute") .WithField("Name", xPath: "Name") .WithField("Value", xPath: "value") ) { Console.WriteLine(ChoCSVWriter.ToText(parser.Select(kvp => kvp.Value).ToExpandoObject())); } }
static void ToTextTest() { ChoTypeConverterFormatSpec.Instance.DateTimeFormat = "G"; ChoTypeConverterFormatSpec.Instance.BooleanFormat = ChoBooleanFormatSpec.YesOrNo; //ChoTypeConverterFormatSpec.Instance.EnumFormat = ChoEnumFormatSpec.Name; List <EmployeeRec> objs = new List <EmployeeRec>(); EmployeeRec rec1 = new EmployeeRec(); rec1.Id = 10; rec1.Name = "Mark"; objs.Add(rec1); EmployeeRec rec2 = new EmployeeRec(); rec2.Id = 200; rec2.Name = "Lou"; objs.Add(rec2); Console.WriteLine(ChoCSVWriter.ToText(objs)); }