-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy pathTrustedJsonFactory.cs
More file actions
43 lines (37 loc) · 1.29 KB
/
TrustedJsonFactory.cs
File metadata and controls
43 lines (37 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace Microsoft.SCIM
{
using System.Collections.Generic;
using Newtonsoft.Json;
public class TrustedJsonFactory : JsonFactory
{
public override Dictionary<string, object> Create(string json)
{
Dictionary<string, object> result =
JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
return result;
}
public override string Create(string[] json)
{
string result = JsonConvert.SerializeObject(json);
return result;
}
public override string Create(Dictionary<string, object> json)
{
string result = JsonConvert.SerializeObject(json);
return result;
}
public override string Create(IDictionary<string, object> json)
{
string result = JsonConvert.SerializeObject(json);
return result;
}
public override string Create(IReadOnlyDictionary<string, object> json)
{
string result = JsonConvert.SerializeObject(json);
return result;
}
}
}