Skip to content

Instantly share code, notes, and snippets.

@mythz
Created February 27, 2017 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mythz/51f5a13f9a95046b052d1f4acba0f2d8 to your computer and use it in GitHub Desktop.
Save mythz/51f5a13f9a95046b052d1f4acba0f2d8 to your computer and use it in GitHub Desktop.
JSON Parsing example
using System.Linq;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
var json = @"{
""data"" : {
""20170127001500"" : [0,0,0,0],
""20170127003000"" : [0,0,0,0],
""20170127004500"" : [0,0,0,0],
""20170127010000"" : [0,0,0,0],
""20170127011500"" : [0,0,0,0]
}
}";
public class Dto
{
public Dictionary<string, List<int>> data { get; set; }
}
var dto = json.FromJson<Dto>();
dto.PrintDump();
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ServiceStack.Text" version="4.0.62" targetFramework="net45" />
<package id="ServiceStack.Client" version="4.0.62" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="4.0.62" targetFramework="net45" />
</packages>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment