using System.Collections.Generic;
public static void Main()
""complaint@simulator.amazonses.com"": {
""time"": ""2018-01-02T20:45:46.65Z"",
""bounceType"": ""null"",
""bounceSubType"": ""null""
""struax@example.org"": {
""time"": ""2018-01-02T20:53:03Z"",
""bounceType"": ""Permanent"",
""bounceSubType"": ""Suppressed""
""bounce-test@service.socketlabs.com"": {
""time"": ""2018-01-02T21:06:40.097Z"",
""bounceType"": ""Permanent"",
""bounceSubType"": ""Suppressed""
""bounce@simulator.amazonses.com"": {
""time"": ""2018-01-02T21:08:02Z"",
""bounceType"": ""Permanent"",
""bounceSubType"": ""General""
""jstrechay@example.org"": {
""time"": ""2018-01-05T06:31:39Z"",
""bounceType"": ""Permanent"",
""bounceSubType"": ""General""
""leematt45@example.org"": {
""time"": ""2018-01-05T06:49:13Z"",
""bounceType"": ""Permanent"",
""bounceSubType"": ""Suppressed""
""afbweb@example.org"": {
""time"": ""2018-01-07T12:50:38Z"",
""bounceType"": ""Transient"",
""bounceSubType"": ""General""
""bajanina2013@example.org"": {
""time"": ""2018-01-02T08:12:19Z"",
""bounceType"": ""Transient"",
""bounceSubType"": ""MailboxFull""
""martin.bunt@example.org"": {
""time"": ""2018-01-05T07:00:24Z"",
""bounceType"": ""null"",
""bounceSubType"": ""null""
var dict = JsonConvert.DeserializeObject<Dictionary<string, BounceItem>>(json);
var list = dict.Select(kvp => { kvp.Value.Email = kvp.Key; return kvp.Value; }).ToList();
string format = "{0,-35} {1,-22} {2,-10} {3,-11} {4}";
Console.WriteLine(string.Format(format, "Email", "Time", "Type", "BounceType", "BounceSubType"));
Console.WriteLine(string.Format(format, new String('-',35), new String('-',22), new String('-',10), new String('-',11), new String('-',13)));
foreach (var item in list)
Console.WriteLine(string.Format(format, item.Email, item.Time, item.Type, item.BounceType, item.BounceSubType));
public string Email { get; set; }
public DateTime Time { get; set; }
public string Type { get; set; }
public string BounceType { get; set; }
public string BounceSubType { get; set; }