Created
September 22, 2018 04:52
-
-
Save bootjp/3548b49d72e479ad63c289387e82f1d7 to your computer and use it in GitHub Desktop.
non class use nest json.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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