Debian Codegraph @

test/integration/targets/powershell_module_utils/module_utils/Ansible.Test.cs

raw
1 //AssemblyReference -Name System.Web.Extensions.dll -CLR Framework
2
3 using System;
4 using System.Collections.Generic;
5 #if CORECLR
6 using System.Text.Json;
7 #else
8 using System.Web.Script.Serialization;
9 #endif
10
11 namespace Ansible.Test
12 {
13 public class OutputTest
14 {
15 public static string GetString()
16 {
17 Dictionary<string, object> obj = new Dictionary<string, object>();
18 obj["a"] = "a";
19 obj["b"] = 1;
20 return ToJson(obj);
21 }
22
23 private static string ToJson(object obj)
24 {
25 #if CORECLR
26 return JsonSerializer.Serialize(obj);
27 #else
28 JavaScriptSerializer jss = new JavaScriptSerializer();
29 return jss.Serialize(obj);
30 #endif
31 }
32 }
33 }
34