Below json and C# class does not match because there are two json objects named same "Event". I am getting null from the second "Event" object. I could not find the matched C# class. What am I doing wrong?
{ "Sequence": 1802487, "BusinessDate": "2020-05-17T00:00:00.0000000", "Event": { "Event": { "@RegId": "2269" } } }
public class Root { public long Sequence { get; set; } public DateTime BusinessDate { get; set; } [JsonProperty("Event")] public Event1 Event { get; set; } } [JsonObject("Event")] public class Event1 { public Event Event { get; set; } } public class Event { [JsonProperty("@RegId")] public string RegId { get; set; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)