Interface IJsonSerializer
This interface makes it possible to change the Json serializer which is used for de- serializing JSON. The default implementation for this, SimpleJson, is included in this project
Namespace: Dapplo.HttpExtensions
Assembly: Dapplo.HttpExtensions.dll
Syntax
public interface IJsonSerializer
Methods
| Improve this Doc View SourceCanDeserializeFrom(Type)
Test if the specified type can be deserialized
Declaration
bool CanDeserializeFrom(Type targetType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | targetType | Type to check |
Returns
| Type | Description |
|---|---|
| System.Boolean | bool |
CanSerializeTo(Type)
Test if the specified type can be serialized to JSON
Declaration
bool CanSerializeTo(Type sourceType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | sourceType | Type to check |
Returns
| Type | Description |
|---|---|
| System.Boolean | bool |
Deserialize(Type, String)
Deserialize a string with Json to the specified type
Declaration
object Deserialize(Type targetType, string jsonString)
Parameters
| Type | Name | Description |
|---|---|---|
| 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 |
Serialize<T>(T)
Serialize the generic object into a string with Json content
Declaration
string Serialize<T>(T jsonObject)
Parameters
| Type | Name | Description |
|---|---|---|
| T | jsonObject | Object to serialize |
Returns
| Type | Description |
|---|---|
| System.String | string with Json content |
Type Parameters
| Name | Description |
|---|---|
| T | Type to serialize |