Class JsonUtility
Namespace:Microsoft.DocAsCode.Common
Assembly:Microsoft.DocAsCode.Common.dll
Syntax
public static class JsonUtility
Fields
|
Improve this Doc
View Source
DefaultSerializer
Declaration
public static readonly ThreadLocal<JsonSerializer> DefaultSerializer
Field Value
Type |
Description |
ThreadLocal<Newtonsoft.Json.JsonSerializer> |
|
Methods
|
Improve this Doc
View Source
Deserialize<T>(TextReader, JsonSerializer)
Declaration
public static T Deserialize<T>(TextReader reader, JsonSerializer serializer = null)
Parameters
Type |
Name |
Description |
TextReader |
reader |
|
Newtonsoft.Json.JsonSerializer |
serializer |
|
Returns
Type Parameters
|
Improve this Doc
View Source
Deserialize<T>(String, JsonSerializer)
Declaration
public static T Deserialize<T>(string path, JsonSerializer serializer = null)
Parameters
Type |
Name |
Description |
String |
path |
|
Newtonsoft.Json.JsonSerializer |
serializer |
|
Returns
Type Parameters
|
Improve this Doc
View Source
FromJsonString<T>(String, JsonSerializer)
Declaration
public static T FromJsonString<T>(this string json, JsonSerializer serializer = null)
Parameters
Type |
Name |
Description |
String |
json |
|
Newtonsoft.Json.JsonSerializer |
serializer |
|
Returns
Type Parameters
|
Improve this Doc
View Source
Serialize(TextWriter, Object, Formatting, JsonSerializer)
Declaration
public static void Serialize(TextWriter writer, object graph, Formatting formatting = Formatting.None, JsonSerializer serializer = null)
Parameters
Type |
Name |
Description |
TextWriter |
writer |
|
Object |
graph |
|
Newtonsoft.Json.Formatting |
formatting |
|
Newtonsoft.Json.JsonSerializer |
serializer |
|
|
Improve this Doc
View Source
Declaration
public static string Serialize(object graph, Formatting formatting = Formatting.None, JsonSerializer serializer = null)
Parameters
Type |
Name |
Description |
Object |
graph |
|
Newtonsoft.Json.Formatting |
formatting |
|
Newtonsoft.Json.JsonSerializer |
serializer |
|
Returns
|
Improve this Doc
View Source
Declaration
public static void Serialize(string path, object graph, Formatting formatting = Formatting.None, JsonSerializer serializer = null)
Parameters
Type |
Name |
Description |
String |
path |
|
Object |
graph |
|
Newtonsoft.Json.Formatting |
formatting |
|
Newtonsoft.Json.JsonSerializer |
serializer |
|
|
Improve this Doc
View Source
Declaration
public static string ToJsonString(this object graph, Formatting formatting = Formatting.None, JsonSerializer serializer = null)
Parameters
Type |
Name |
Description |
Object |
graph |
|
Newtonsoft.Json.Formatting |
formatting |
|
Newtonsoft.Json.JsonSerializer |
serializer |
|
Returns