JsonSerializer
Creates an instance of a Type from a string value
Assembly: ServiceStack.Text.dll
View Source
Declaration
public static class JsonSerializer
Properties
UTF8Encoding
View Source
Declaration
[Obsolete("Use JsConfig.UTF8Encoding")]
public static UTF8Encoding UTF8Encoding { get; set; }
OnSerialize
View Source
Declaration
public static Action<object> OnSerialize { get; set; }
Fields
BufferSize
View Source
Declaration
public static int BufferSize
Methods
DeserializeFromString<T>(String)
View Source
Declaration
public static T DeserializeFromString<T>(string value)
Returns
<T>
Parameters
Type | Name |
---|---|
System.String | value |
Type Parameters
T
DeserializeFromSpan<T>(ReadOnlySpan<Char>)
View Source
Declaration
public static T DeserializeFromSpan<T>(ReadOnlySpan<char> value)
Returns
<T>
Parameters
Type | Name |
---|---|
ReadOnlySpan<System.Char> | value |
Type Parameters
T
DeserializeFromReader<T>(TextReader)
View Source
Declaration
public static T DeserializeFromReader<T>(TextReader reader)
Returns
<T>
Parameters
Type | Name |
---|---|
System.IO.TextReader | reader |
Type Parameters
T
DeserializeFromSpan(Type, ReadOnlySpan<Char>)
View Source
Declaration
public static object DeserializeFromSpan(Type type, ReadOnlySpan<char> value)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Type | type |
ReadOnlySpan<System.Char> | value |
DeserializeFromString(String, Type)
View Source
Declaration
public static object DeserializeFromString(string value, Type type)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.String | value |
System.Type | type |
DeserializeFromReader(TextReader, Type)
View Source
Declaration
public static object DeserializeFromReader(TextReader reader, Type type)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.IO.TextReader | reader |
System.Type | type |
SerializeToString<T>(T)
View Source
Declaration
public static string SerializeToString<T>(T value)
Returns
System.String
Parameters
Type | Name |
---|---|
<T> | value |
Type Parameters
T
SerializeToString(Object, Type)
View Source
Declaration
public static string SerializeToString(object value, Type type)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | value |
System.Type | type |
SerializeToWriter<T>(T, TextWriter)
View Source
Declaration
public static void SerializeToWriter<T>(T value, TextWriter writer)
Parameters
Type | Name |
---|---|
<T> | value |
System.IO.TextWriter | writer |
Type Parameters
T
SerializeToWriter(Object, Type, TextWriter)
View Source
Declaration
public static void SerializeToWriter(object value, Type type, TextWriter writer)
Parameters
Type | Name |
---|---|
System.Object | value |
System.Type | type |
System.IO.TextWriter | writer |
SerializeToStream<T>(T, Stream)
View Source
Declaration
public static void SerializeToStream<T>(T value, Stream stream)
Parameters
Type | Name |
---|---|
<T> | value |
System.IO.Stream | stream |
Type Parameters
T
SerializeToStream(Object, Type, Stream)
View Source
Declaration
public static void SerializeToStream(object value, Type type, Stream stream)
Parameters
Type | Name |
---|---|
System.Object | value |
System.Type | type |
System.IO.Stream | stream |
DeserializeFromStream<T>(Stream)
View Source
Declaration
public static T DeserializeFromStream<T>(Stream stream)
Returns
<T>
Parameters
Type | Name |
---|---|
System.IO.Stream | stream |
Type Parameters
T
DeserializeFromStream(Type, Stream)
View Source
Declaration
public static object DeserializeFromStream(Type type, Stream stream)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Type | type |
System.IO.Stream | stream |
DeserializeFromStreamAsync(Type, Stream)
View Source
Declaration
public static Task<object> DeserializeFromStreamAsync(Type type, Stream stream)
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
System.Type | type |
System.IO.Stream | stream |
DeserializeFromStreamAsync<T>(Stream)
View Source
Declaration
public static async Task<T> DeserializeFromStreamAsync<T>(Stream stream)
Returns
System.Threading.Tasks.Task<<T>>
Parameters
Type | Name |
---|---|
System.IO.Stream | stream |
Type Parameters
T
DeserializeResponse<T>(WebRequest)
View Source
Declaration
public static T DeserializeResponse<T>(WebRequest webRequest)
Returns
<T>
Parameters
Type | Name |
---|---|
System.Net.WebRequest | webRequest |
Type Parameters
T
DeserializeResponse<T>(Type, WebRequest)
View Source
Declaration
public static object DeserializeResponse<T>(Type type, WebRequest webRequest)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Type | type |
System.Net.WebRequest | webRequest |
Type Parameters
T
DeserializeRequest<T>(WebRequest)
View Source
Declaration
public static T DeserializeRequest<T>(WebRequest webRequest)
Returns
<T>
Parameters
Type | Name |
---|---|
System.Net.WebRequest | webRequest |
Type Parameters
T
DeserializeRequest(Type, WebRequest)
View Source
Declaration
public static object DeserializeRequest(Type type, WebRequest webRequest)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Type | type |
System.Net.WebRequest | webRequest |
DeserializeResponse<T>(WebResponse)
View Source
Declaration
public static T DeserializeResponse<T>(WebResponse webResponse)
Returns
<T>
Parameters
Type | Name |
---|---|
System.Net.WebResponse | webResponse |
Type Parameters
T
DeserializeResponse(Type, WebResponse)
View Source
Declaration
public static object DeserializeResponse(Type type, WebResponse webResponse)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Type | type |
System.Net.WebResponse | webResponse |