Class ODataJsonConverter
Handles resolving interfaces to the correct derived class during serialization/deserialization.
Namespace: Microsoft.Graph.Communications.Common.OData
Assembly: Microsoft.Graph.Communications.Common.dll
Syntax
public sealed class ODataJsonConverter : JsonConverter
  Constructors
ODataJsonConverter(Assembly[])
Initializes a new instance of the ODataJsonConverter class.
Declaration
public ODataJsonConverter(params Assembly[] typeAssemblies)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Assembly[] | typeAssemblies | The type assemblies.  | 
      
Properties
CanWrite
Declaration
public override bool CanWrite { get; }
  Property Value
| Type | Description | 
|---|---|
| Boolean | 
Methods
CanConvert(Type)
Declaration
public override bool CanConvert(Type objectType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Type | objectType | 
Returns
| Type | Description | 
|---|---|
| Boolean | 
ReadJson(JsonReader, Type, Object, JsonSerializer)
Deserializes the object to the correct type.
Declaration
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Newtonsoft.Json.JsonReader | reader | The Newtonsoft.Json.JsonReader to read from.  | 
      
| Type | objectType | The interface type.  | 
      
| Object | existingValue | The existing value of the object being read.  | 
      
| Newtonsoft.Json.JsonSerializer | serializer | The Newtonsoft.Json.JsonSerializer for deserialization.  | 
      
Returns
| Type | Description | 
|---|---|
| Object | The deserialized object  | 
      
WriteJson(JsonWriter, Object, JsonSerializer)
Declaration
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Newtonsoft.Json.JsonWriter | writer | |
| Object | value | |
| Newtonsoft.Json.JsonSerializer | serializer |