Skip to content

Instantly share code, notes, and snippets.

@Layoric
Created August 27, 2019 03:03
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 Layoric/a8220c2c4a5d5c3c19c55e796827198d to your computer and use it in GitHub Desktop.
Save Layoric/a8220c2c4a5d5c3c19c55e796827198d to your computer and use it in GitHub Desktop.
SS enum example
using System.Linq;
using System;
using ServiceStack;
using ServiceStack.Text;
public enum Foo
{
None,
Test,
Bar
}
public class MyDto
{
public Foo test { get;set; }
}
var jsonStr = "{ \"test\": \"bar\" }";
var myObj = jsonStr.FromJson<MyDto>();
myObj.PrintDump();
// 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="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