Skip to content

Instantly share code, notes, and snippets.

@bootjp
Created September 22, 2018 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bootjp/3548b49d72e479ad63c289387e82f1d7 to your computer and use it in GitHub Desktop.
Save bootjp/3548b49d72e479ad63c289387e82f1d7 to your computer and use it in GitHub Desktop.
non class use nest json.
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace csharp
{
class Program
{
static void Main(string[] args)
{
var innerMap = new Dictionary<string, string>();
innerMap.Add("key", "value");
var outerMap = new Dictionary<string, Dictionary<string, string> >();
outerMap.Add("outer_json", innerMap);
Console.WriteLine(JsonConvert.SerializeObject(outerMap));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment