using System.Collections.Generic;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Linq;
public static void Main(string[] args)
{""deviceName"":""Testing"",
""timestamp"":""2020-03-14T01:14:39Z"",
""timestamp"":""2020-03-14T01:14:25Z"",
""Name"":""Total_Yield"",
""timestamp"":""2020-03-14T01:14:25Z"",
""Name"":""Serial_Number"",
""timestamp"":""2020-03-14T01:14:25Z"",
""Name"":""MPPT_A_Voltage"",
""timestamp"":""2020-03-14T01:14:25Z"",
""Name"":""Frequency_AC"",
""timestamp"":""2020-03-14T01:14:25Z"",
JObject jsonMsg = JObject.Parse(json);
var deviceName = jsonMsg["deviceName"].ToString();
var solarStatusKeyValue = jsonMsg["tags"];
JArray a = JArray.Parse(solarStatusKeyValue.ToString());
foreach (JObject o in a.Children<JObject>()){
string name = o["Name"].ToString().ToLower();
string value = o["Value"].ToString();
var input = new Standard(deviceName, name, value);
Console.WriteLine(input.device_name);
Console.WriteLine(input.tag_name);
Console.WriteLine(input.tag_value);
public string device_name { get; set; }
public string tag_name { get; set; }
public string tag_value { get; set; }
public Standard(string device_name, string tag_name, string tag_value)
this.device_name = device_name;
this.tag_name = tag_name;
this.tag_value = tag_value;