Created
June 21, 2017 06:25
-
-
Save darkthread/d0422d17efde5d3e95c4ce4173c70e69 to your computer and use it in GitHub Desktop.
Revisions
-
darkthread created this gist
Jun 21, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ using System.Linq; using ServiceStack; using ServiceStack.Text; using System.Collections.Generic; using ServiceStack.Text.Common; public class POCO { public string Prop1 { get; set; } public string Prop2 { get; set; } public string Prop3 { get; set; } public string Prop4 { get; set; } public string Prop5 { get; set; } } var srcList = new List<POCO>() { new POCO() { Prop1 = "1", Prop2 = JsWriter.ListStartChar + "2", Prop3 = JsWriter.MapStartChar + "3", Prop4 = "4", Prop5 = "5" } }; var csv = CsvSerializer.SerializeToCsv<POCO>(srcList); var desList = csv.FromCsv<List<POCO>>(); var src = srcList[0]; var des = desList[0]; $"Compare Prop5: src={src.Prop5}, des={des.Prop5}".Print(); if (src.Prop5 != des.Prop5) "Deserialization Test Failed!".Print(); // Save a copy of this *public* Gist by clicking the "Save As" below This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="ServiceStack.Text" version="4.5.8" targetFramework="net45" /> <package id="ServiceStack.Client" version="4.5.8" targetFramework="net45" /> <package id="ServiceStack.Interfaces" version="4.5.8" targetFramework="net45" /> </packages>