Skip to content

Instantly share code, notes, and snippets.

@mythz
Created April 7, 2019 20:19
Show Gist options
  • Save mythz/17142ed8796b025466460dfd67635b9d to your computer and use it in GitHub Desktop.
Save mythz/17142ed8796b025466460dfd67635b9d to your computer and use it in GitHub Desktop.
CSV Serialize Test
using System;
using System.Linq;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
class ListEntry
{
public ListEntry(string a, string b)
{
SomeField = a;
SomeField2 = b;
}
public string SomeField { get; set; }
public string SomeField2 { get; set; }
}
class CurrentList : List<ListEntry>
{
}
var testList = new CurrentList();
testList.Add(new ListEntry("pam","tam"));
testList.Add(new ListEntry("qqq","aaa"));
string csvQueueInit = CsvSerializer.SerializeToCsv(testList);
csvQueueInit.Print();
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Memory" version="4.5.2" targetFramework="net45" />
<package id="ServiceStack.Text" version="5.5.0" targetFramework="net45" />
<package id="ServiceStack.Client" version="5.5.0" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="5.5.0" targetFramework="net45" />
</packages>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment