Skip to content

Commit ae7f332

Browse files
committed
Code added for C# frameworks
1 parent b789f3c commit ae7f332

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

languages/CSharpClass.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,6 @@
9999
"staticImports": "using System;\nusing System.Collections.Generic;",
100100
"supportsCamelcasing": false,
101101
"methods": {
102-
}
102+
},
103+
"exampleCode": "## Example\n\n\n#### Decoding:\nThe example below shows how to decode an instance of `<!RootClassName>` type from JSON object.\n\n```csharp\nstring json = \"...\"; // Your JSON String.\n\n// minimum supported version: Win 8\nJsonObject root = Windows.Data.Json.JsonValue.Parse(jsonString).GetObject();\nConsole.WriteLine(root[\"Name\"].GetString()); // Here `Name` is key in JSON with string value.\nConsole.WriteLine(root[\"Address\"].GetObject()[\"State\"].GetString()); // Here `Address` is object which have `State` key with string value.\n```\n\n"
103104
}

languages/CSharpNewtonsoft.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,6 @@
9999
"staticImports": "using System;\nusing System.Collections.Generic;\n\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;",
100100
"supportsCamelcasing": true,
101101
"methods": {
102-
}
102+
},
103+
"exampleCode": "## Example\n\n\n#### Decoding:\nThe example below shows how to decode an instance of `<!RootClassName>` type from JSON object.\n\n```csharp\nstring json = \"...\"; // Your JSON String.\n\n<!RootClassName> model = JsonConvert.DeserializeObject<<!RootClassName>>(json);\n```\n\n\n#### Encoding: \nThe example below shows how to encode an instance of a simple `<!RootClassName>` type into a JSON object.\n\n```java\n<!RootClassName> model = new <!RootClassName>();\n// Assign value to variables.\n\nstring json = JsonConvert.SerializeObject(model);\n```"
103104
}

0 commit comments

Comments
 (0)