Skip to content

Instantly share code, notes, and snippets.

@xplicit
Created June 26, 2017 21:55
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 xplicit/c9906679188b0b7ff1d8f496d5e3f506 to your computer and use it in GitHub Desktop.
Save xplicit/c9906679188b0b7ff1d8f496d5e3f506 to your computer and use it in GitHub Desktop.
Leading Zeroes Deserialization
using System.Globalization;
using ServiceStack.Text;
using System;
JsConfig<Int32>.DeSerializeFn = x => Int32.Parse(x, CultureInfo.InvariantCulture);
var result = JsonSerializer.DeserializeFromString("011",typeof(Int32));
// Save a copy of this *public* Gist by clicking the "Save As" below
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ServiceStack.Text" version="4.0.60" targetFramework="net45" />
<package id="ServiceStack.Client" version="4.0.60" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="4.0.60" targetFramework="net45" />
</packages>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment