Provides a base class for a JsonConverter that serializes a an input type as some other output type
More...
|
override object | ReadJson (JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) |
| Reads the JSON representation of the object. More...
|
|
override void | WriteJson (JsonWriter writer, object value, JsonSerializer serializer) |
| Writes the JSON representation of the object. More...
|
|
override bool | CanConvert (Type objectType) |
| Determines whether this instance can convert the specified object type. More...
|
|
|
virtual T | Create (Type type, JToken token) |
| Creates an instance of the un-projected type to be deserialized More...
|
|
abstract TResult | Convert (T value) |
| Convert the input value to a value to be serialized More...
|
|
abstract T | Convert (TResult value) |
| Converts the input value to be deserialized More...
|
|
Provides a base class for a JsonConverter that serializes a an input type as some other output type
- Template Parameters
-
T | The type to be serialized |
TResult | The output serialized type |
Definition at line 29 of file TypeChangeJsonConverter.cs.
◆ ReadJson()
Reads the JSON representation of the object.
- Parameters
-
reader | The T:Newtonsoft.Json.JsonReader to read from. |
objectType | Type of the object. |
existingValue | The existing value of object being read. |
serializer | The calling serializer. |
- Returns
- The object value.
Definition at line 46 of file TypeChangeJsonConverter.cs.
◆ WriteJson()
Writes the JSON representation of the object.
- Parameters
-
writer | The T:Newtonsoft.Json.JsonWriter to write to. |
value | The value. |
serializer | The calling serializer. |
Definition at line 61 of file TypeChangeJsonConverter.cs.
◆ CanConvert()
Determines whether this instance can convert the specified object type.
- Parameters
-
objectType | Type of the object. |
- Returns
true
if this instance can convert the specified object type; otherwise, false
.
Definition at line 76 of file TypeChangeJsonConverter.cs.
◆ Create()
◆ Convert() [1/2]
Convert the input value to a value to be serialized
- Parameters
-
value | The input value to be converted before serialziation |
- Returns
- A new instance of TResult that is to be serialzied
◆ Convert() [2/2]
Converts the input value to be deserialized
- Parameters
-
value | The deserialized value that needs to be converted to T |
- Returns
- The converted value
◆ PopulateProperties
The documentation for this class was generated from the following file: