Skip to main content

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
TypeName
System.Stringvalue
Type Parameters
  • T

DeserializeFromSpan<T>(ReadOnlySpan<Char>)

View Source
Declaration
public static T DeserializeFromSpan<T>(ReadOnlySpan<char> value)
Returns

<T>

Parameters
TypeName
ReadOnlySpan<System.Char>value
Type Parameters
  • T

DeserializeFromReader<T>(TextReader)

View Source
Declaration
public static T DeserializeFromReader<T>(TextReader reader)
Returns

<T>

Parameters
TypeName
System.IO.TextReaderreader
Type Parameters
  • T

DeserializeFromSpan(Type, ReadOnlySpan<Char>)

View Source
Declaration
public static object DeserializeFromSpan(Type type, ReadOnlySpan<char> value)
Returns

System.Object

Parameters
TypeName
System.Typetype
ReadOnlySpan<System.Char>value

DeserializeFromString(String, Type)

View Source
Declaration
public static object DeserializeFromString(string value, Type type)
Returns

System.Object

Parameters
TypeName
System.Stringvalue
System.Typetype

DeserializeFromReader(TextReader, Type)

View Source
Declaration
public static object DeserializeFromReader(TextReader reader, Type type)
Returns

System.Object

Parameters
TypeName
System.IO.TextReaderreader
System.Typetype

SerializeToString<T>(T)

View Source
Declaration
public static string SerializeToString<T>(T value)
Returns

System.String

Parameters
TypeName
<T>value
Type Parameters
  • T

SerializeToString(Object, Type)

View Source
Declaration
public static string SerializeToString(object value, Type type)
Returns

System.String

Parameters
TypeName
System.Objectvalue
System.Typetype

SerializeToWriter<T>(T, TextWriter)

View Source
Declaration
public static void SerializeToWriter<T>(T value, TextWriter writer)
Parameters
TypeName
<T>value
System.IO.TextWriterwriter
Type Parameters
  • T

SerializeToWriter(Object, Type, TextWriter)

View Source
Declaration
public static void SerializeToWriter(object value, Type type, TextWriter writer)
Parameters
TypeName
System.Objectvalue
System.Typetype
System.IO.TextWriterwriter

SerializeToStream<T>(T, Stream)

View Source
Declaration
public static void SerializeToStream<T>(T value, Stream stream)
Parameters
TypeName
<T>value
System.IO.Streamstream
Type Parameters
  • T

SerializeToStream(Object, Type, Stream)

View Source
Declaration
public static void SerializeToStream(object value, Type type, Stream stream)
Parameters
TypeName
System.Objectvalue
System.Typetype
System.IO.Streamstream

DeserializeFromStream<T>(Stream)

View Source
Declaration
public static T DeserializeFromStream<T>(Stream stream)
Returns

<T>

Parameters
TypeName
System.IO.Streamstream
Type Parameters
  • T

DeserializeFromStream(Type, Stream)

View Source
Declaration
public static object DeserializeFromStream(Type type, Stream stream)
Returns

System.Object

Parameters
TypeName
System.Typetype
System.IO.Streamstream

DeserializeFromStreamAsync(Type, Stream)

View Source
Declaration
public static Task<object> DeserializeFromStreamAsync(Type type, Stream stream)
Returns

System.Threading.Tasks.Task<System.Object>

Parameters
TypeName
System.Typetype
System.IO.Streamstream

DeserializeFromStreamAsync<T>(Stream)

View Source
Declaration
public static async Task<T> DeserializeFromStreamAsync<T>(Stream stream)
Returns

System.Threading.Tasks.Task<<T>>

Parameters
TypeName
System.IO.Streamstream
Type Parameters
  • T

DeserializeResponse<T>(WebRequest)

View Source
Declaration
public static T DeserializeResponse<T>(WebRequest webRequest)
Returns

<T>

Parameters
TypeName
System.Net.WebRequestwebRequest
Type Parameters
  • T

DeserializeResponse<T>(Type, WebRequest)

View Source
Declaration
public static object DeserializeResponse<T>(Type type, WebRequest webRequest)
Returns

System.Object

Parameters
TypeName
System.Typetype
System.Net.WebRequestwebRequest
Type Parameters
  • T

DeserializeRequest<T>(WebRequest)

View Source
Declaration
public static T DeserializeRequest<T>(WebRequest webRequest)
Returns

<T>

Parameters
TypeName
System.Net.WebRequestwebRequest
Type Parameters
  • T

DeserializeRequest(Type, WebRequest)

View Source
Declaration
public static object DeserializeRequest(Type type, WebRequest webRequest)
Returns

System.Object

Parameters
TypeName
System.Typetype
System.Net.WebRequestwebRequest

DeserializeResponse<T>(WebResponse)

View Source
Declaration
public static T DeserializeResponse<T>(WebResponse webResponse)
Returns

<T>

Parameters
TypeName
System.Net.WebResponsewebResponse
Type Parameters
  • T

DeserializeResponse(Type, WebResponse)

View Source
Declaration
public static object DeserializeResponse(Type type, WebResponse webResponse)
Returns

System.Object

Parameters
TypeName
System.Typetype
System.Net.WebResponsewebResponse