using System.Collections.Generic;
public static void Main()
string jsonMessage = @" {
'objectName' : 'SWIP_AGC Control Number',
'startDateTime' : '2018-09-26T17:50:00Z',
'endDateTime' : '2018-09-26T17:51:00Z',
'startDateTime' : '2018-09-26T17:51:00Z',
'endDateTime' : '2018-09-26T17:52:00Z',
'startDateTime' : '2018-09-26T17:52:00Z',
'endDateTime' : '2018-09-26T17:53:00Z',
'startDateTime' : '2018-09-26T17:53:00Z',
'endDateTime' : '2018-09-26T17:54:00Z',
'startDateTime' : '2018-09-26T17:54:00Z',
'endDateTime' : '2018-09-26T17:55:00Z',
Console.WriteLine("Processing a Current value PCI message. Standby....");
PciInboundMessageIntervalControl pciMessageCurrent = JsonConvert.DeserializeObject<PciInboundMessageIntervalControl>(jsonMessage);
Console.WriteLine("Value for External ID is: " + pciMessageCurrent.ExternalId);
foreach(var payloadObject in pciMessageCurrent.SchdIntvContPayload)
Console.WriteLine("Payload value found as: " + payloadObject);
foreach(var value in payloadObject.SchdIntvContPayloadDataValues)
Console.WriteLine("Start time is: " + value.StartDateTime);
Console.WriteLine("End time is: " + value.EndDateTime);
Console.WriteLine("Value is: " + value.Value);
Console.WriteLine("Error attempting to map values. Error is: " + e.Message);
public class PciInboundMessageIntervalControl
public string ObjectName { get; set; }
public string ObjectType { get; set; }
public string ProductType { get; set; }
public string ExternalId { get; set; }
[JsonProperty("SchdIntContPayload")]
public IList<SchdIntvContPayloadData> SchdIntvContPayload { get; set; }
public class SchdIntvContPayloadData
[JsonProperty("SchdIntervalDataValues")]
public IList<SchdIntvContPayloadDataValuesData> SchdIntvContPayloadDataValues { get; set; }
public class SchdIntvContPayloadDataValuesData
public DateTime StartDateTime { get; set; }
public DateTime EndDateTime { get; set; }
public double Value { get; set; }