using System.Collections.Generic;
using Newtonsoft.Json.Linq;
public static void Main()
""12/29/2020 1:18:40 AM"",
""Engine - Natural Gas"",
""MOBIL PEGASUS SPECIAL CF"",
""-NO ACTION REQUIRED ON OIL OR ENGINE. Results indicate that all levels are within acceptable ranges. Examine progressive changes and monitor results for changing trends. Sample at next scheduled interval. Contact your ExxonMobil representative for further assistance if necessary.""
""12/29/2020 1:18:40 AM"",
""Engine - Natural Gas"",
""MOBIL PEGASUS SPECIAL CF"",
""-NO ACTION REQUIRED ON OIL OR ENGINE. Results indicate that all levels are within acceptable ranges. Examine progressive changes and monitor results for changing trends. Sample at next scheduled interval. Contact your ExxonMobil representative for further assistance if necessary.""
""12/29/2020 1:18:40 AM"",
""Engine - Natural Gas"",
""MOBIL PEGASUS SPECIAL CF"",
""-NO ACTION REQUIRED ON OIL OR ENGINE. Results indicate that all levels are within acceptable ranges. Examine progressive changes and monitor results for changing trends. Sample at next scheduled interval. Contact your ExxonMobil representative for further assistance if necessary.""
""12/29/2020 1:18:40 AM"",
""Engine - Natural Gas"",
""MOBIL PEGASUS SPECIAL CF"",
""-NO ACTION REQUIRED ON OIL OR ENGINE. Results indicate that all levels are within acceptable ranges. Examine progressive changes and monitor results for changing trends. Sample at next scheduled interval. Contact your ExxonMobil representative for further assistance if necessary.""
""12/29/2020 9:58:03 PM"",
""St. Francis Hydraulic"",
""St. Francis Hydraulic"",
""Engine - Natural Gas"",
""MOBIL PEGASUS SPECIAL CF"",
""-ACTION REQUIRED - UNACCEPTABLE VISCOSITY. The viscosity of the sampled oil has either increased or decreased by more than 20 percent since its initial installment as a new oil. The oil is unfit for continued use and must be changed immediately in order to comply with EPA RICE-NESHAP oil analysis standards. Contact your ExxonMobil representative for further assistance if necessary.""
""12/29/2020 2:39:49 AM"",
""Engine - Natural Gas"",
""MOBIL PEGASUS SPECIAL CF"",
""-ACTION REQUIRED - REDUCED OIL VISCOSITY. Determine cause of reduced oil viscosity and take corrective action. Reduced viscosities can impair the lubricant's ability to protect the equipment. Possible causes of reduced viscosity include: a. Initial fill or contact with oil that has a lower viscosity; b. Contamination with a fuel or solvent; c. Incorrectly labeled sampled. Inspect the system for signs of fuel or coolant ingression. Resample the oil after corrective actions have been implemented. If the condition continues or escalates, recharge the system with new oil. Contact your ExxonMobil representative for further assistance if necessary. -ACTION REQUIRED - UNSATISFACTORY OIL CONDITION. Test results indicate that the condition of this oil sample is unsatisfactory. The oil may be unfit for continued use and should be closely monitored further condition regressions. Contact your ExxonMobil representative for further assistance if necessary.""
""12/29/2020 1:18:40 AM"",
""Americus - Bulk Storage Tank"",
""Engine - Natural Gas"",
""MOBIL PEGASUS SPECIAL CF"",
""-NO ACTION REQUIRED ON OIL OR ENGINE. Results indicate that all levels are within acceptable ranges. Examine progressive changes and monitor results for changing trends. Sample at next scheduled interval. Contact your ExxonMobil representative for further assistance if necessary.""
MemoryStream responseStream = new MemoryStream(Encoding.UTF8.GetBytes(json));
var results = GetResultsFromResponseStream(responseStream);
foreach (var item in results)
foreach (var kvp in item)
Console.WriteLine(kvp.Key + ": " + kvp.Value);
static List<Dictionary<string, string>> GetResultsFromResponseStream(Stream responseStream)
using (StreamReader streamReader = new StreamReader(responseStream))
using (JsonReader jsonReader = new JsonTextReader(streamReader))
JObject obj = JObject.Load(jsonReader);
JArray keys = (JArray)obj["Columns"];
List<Dictionary<string, string>> results = obj["Results"]
.Select(a => keys.Zip(a, (k, v) => new { Key = (string)k, Value = (string)v })
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value))