Improve this Doc View Source

Interface IJsonSerializer

This interface makes it possible to change the Json serializer which is used for de- serializing JSON. As a default implementation is used, using SimpleJson.

Namespace:Dapplo.HttpExtensions
Assembly:Dapplo.HttpExtensions.dll
Syntax
public interface IJsonSerializer

Methods

| Improve this Doc View Source

DeserializeJson(Type, String)

Deserialize a string with Json to the specified type

Declaration
object DeserializeJson(Type targetType, string jsonString)
Parameters
Type Name Description
System.Type targetType

Type to deserialize to

System.String jsonString

string with json content

Returns
Type Description
System.Object

an object of type targetType or null

| Improve this Doc View Source

DeserializeJson<TResult>(String)

Deserialize a string with Json to the generic type

Declaration
TResult DeserializeJson<TResult>(string jsonString)where TResult : class
Parameters
Type Name Description
System.String jsonString

string with json content

Returns
Type Description
TResult

TResult

| Improve this Doc View Source

SerializeJson<T>(T)

Serialize the generic object into a string with Json content

Declaration
string SerializeJson<T>(T jsonObject)
Parameters
Type Name Description
T jsonObject

Object to serialize

Returns
Type Description
System.String

string with Json content