C# data contract for complex JSON object

后端 未结 3 1611
暗喜
暗喜 2021-01-21 11:32

This is probably something really simple and I looked everywhere and tried everything I could come up with. So I apologize if this is a simple search and I was just looking for

3条回答
  •  后悔当初
    2021-01-21 11:54

    Use Json2CSharp.com to make sure you have everything correct:

     public class Datum
    {
    public string data1 { get; set; }
    public string data2 { get; set; }
    public string data3 { get; set; }
    public string connectorType { get; set; }
    public string sourceUri { get; set; }
    public string destinationUri { get; set; }
    public string rails { get; set; }
    public string data6 { get; set; }
    public string groupId { get; set; }
    public string failbackAction { get; set; }
    public string normal { get; set; }
    public string failoverAction { get; set; }
    public string artifactId { get; set; }
    public string normalState { get; set; }
    public string instanceId { get; set; }
    }
    
    public class RootObject
    {
    public string appname { get; set; }
    public string key { get; set; }
    public List data { get; set; }
    public string updateId { get; set; }
    public string updateTS { get; set; }
    public string creationUser { get; set; }
    }
    

提交回复
热议问题