Created
December 5, 2020 16:27
-
-
Save wwwlicious/d4dd00bbc9a150a69e782a07753c575e to your computer and use it in GitHub Desktop.
SnakeCake_Deserialize_CustomScope
This file contains 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 characters
using System.Linq; | |
using ServiceStack; | |
using ServiceStack.Text; | |
public class Test | |
{ | |
public string Id {get;set;} | |
public string IdName {get;set;} | |
} | |
using (var scope = JsConfig.BeginScope()) | |
{ | |
scope.TextCase = TextCase.SnakeCase; | |
var test = new Test { Id= "id", IdName = "idname" }; | |
var json = test.ToJson(); | |
var testOut = json.FromJson<Test>(); | |
testOut.PrintDump(); | |
} | |
// Save a copy of this *public* Gist by clicking the "Save As" below https://servicestack.net/ |
This file contains 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 characters
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="ServiceStack.Text" version="5.10.0" targetFramework="net5.0" /> | |
<package id="ServiceStack.Client" version="5.10.0" targetFramework="net5.0" /> | |
<package id="ServiceStack.Common" version="5.10.0" targetFramework="net5.0" /> | |
<package id="ServiceStack.Interfaces" version="5.10.0" targetFramework="net5.0" /> | |
</packages> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment