Skip to content

Instantly share code, notes, and snippets.

@afmorris
Last active October 19, 2018 01:33
Show Gist options
  • Save afmorris/22731c29d5e1ddbf2c3b840f260c308f to your computer and use it in GitHub Desktop.
Save afmorris/22731c29d5e1ddbf2c3b840f260c308f to your computer and use it in GitHub Desktop.
SO-52751177-Previous
using System.Linq;
using ServiceStack;
using ServiceStack.Text;
using System;
JsConfig.IncludeNullValues = false;
JsConfig.ExcludeDefaultValues = false;
JsConfig<Guid>.SerializeFn = guid => guid.ToString();
var tt = new { Name="Fred", Value=Guid.Empty, Value2=Guid.NewGuid() };
var test = tt.ToJson();
Console.WriteLine(test);
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ServiceStack.Text" version="5.2.0" targetFramework="net45" />
<package id="ServiceStack.Client" version="5.2.0" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="5.2.0" targetFramework="net45" />
</packages>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment