Last active
October 18, 2018 12:39
-
-
Save mythz/d3ff39c7052b5b0d6e5dfe4d5e570eb9 to your computer and use it in GitHub Desktop.
test json deserialization
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; | |
using System.Linq; | |
using System.Collections.Generic; | |
using ServiceStack; | |
using ServiceStack.Text; | |
var json = "{\"Confirmations\":[{\"ChangeId\":126552616,\"Confirmed\":true}]}"; | |
[Route("/confirmations", "PUT")] | |
public class PutConfirmed : IReturn<PutConfirmedResponse> | |
{ | |
#region Public Properties | |
public List<Confirmation> Confirmations { get; set; } | |
#endregion Public Properties | |
} | |
public class Confirmation | |
{ | |
#region Public Constructors | |
public Confirmation() | |
{ | |
ChangeId = 0; | |
Confirmed = false; | |
} | |
#endregion Public Constructors | |
#region Public Properties | |
public int ChangeId { get; set; } | |
public bool Confirmed { get; set; } | |
#endregion Public Properties | |
} | |
public class PutConfirmedResponse | |
{ | |
#region Public Properties | |
public bool IsSucceed { get; set; } | |
public ResponseStatus ResponseStatus { get; set; } | |
#endregion Public Properties | |
} | |
var dto = json.FromJson<PutConfirmed>(); | |
dto.PrintDump(); |
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.4.0" targetFramework="net45" /> | |
<package id="ServiceStack.Client" version="5.4.0" targetFramework="net45" /> | |
<package id="ServiceStack.Interfaces" version="5.4.0" targetFramework="net45" /> | |
</packages> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment