Class JsonNetJsonSerializer
Made to have Dapplo.HttpExtension use Json.NET
Inheritance
System.Object
JsonNetJsonSerializer
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Dapplo.HttpExtensions.JsonNet
Assembly: Dapplo.HttpExtensions.JsonNet.dll
Syntax
public class JsonNetJsonSerializer : IJsonSerializer
Properties
| Improve this Doc View SourceSettings
The JsonSerializerSettings used in the JsonNetJsonSerializer
Declaration
public JsonSerializerSettings Settings { get; set; }
Property Value
Type | Description |
---|---|
Newtonsoft.Json.JsonSerializerSettings |
Methods
| Improve this Doc View SourceCanDeserializeFrom(Type)
Test if the specified type can be deserialized
Declaration
public bool CanDeserializeFrom(Type targetType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | Type to check |
Returns
Type | Description |
---|---|
System.Boolean | bool |
CanSerializeTo(Type)
Test if the specified type can be serialized to JSON
Declaration
public bool CanSerializeTo(Type sourceType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | sourceType | Type to check |
Returns
Type | Description |
---|---|
System.Boolean | bool |
Deserialize(Type, String)
Deserialize the specified json string into the target type
Declaration
public object Deserialize(Type targetType, string jsonString)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | |
System.String | jsonString |
Returns
Type | Description |
---|---|
System.Object |
RegisterGlobally(Boolean)
Register this IJsonSerializer
Declaration
public static void RegisterGlobally(bool force = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | force | bool to specify if this also needs to be set when another serializer is already specified |
Serialize<T>(T)
Serialize the passed object into a json string
Declaration
public string Serialize<T>(T jsonObject)
Parameters
Type | Name | Description |
---|---|---|
T | jsonObject |
Returns
Type | Description |
---|---|
System.String |
Type Parameters
Name | Description |
---|---|
T |