Show / Hide Table of Contents

    Class KeyValuePairConverter

    Converts a System.Collections.Generic.KeyValuePair<TKey, TValue> to and from JSON.

    Inheritance
    System.Object
    JsonConverter
    KeyValuePairConverter
    Inherited Members
    JsonConverter.CanRead
    JsonConverter.CanWrite
    JsonConverter.IsGenericConverter
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Bayat.Json.Converters
    Assembly: Bayat.Json.Runtime.dll
    Syntax
    public class KeyValuePairConverter : JsonConverter

    Methods

    | Improve this Doc View Source

    CanConvert(Type)

    Determines whether this instance can convert the specified object type.

    Declaration
    public override bool CanConvert(Type objectType)
    Parameters
    Type Name Description
    System.Type objectType

    Type of the object.

    Returns
    Type Description
    System.Boolean

    true if this instance can convert the specified object type; otherwise, false.

    Overrides
    JsonConverter.CanConvert(Type)
    | Improve this Doc View Source

    ReadJson(JsonReader, Type, Object, JsonSerializerReader)

    Reads the JSON representation of the object.

    Declaration
    public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializerReader internalReader)
    Parameters
    Type Name Description
    JsonReader reader

    The JsonReader to read from.

    System.Type objectType

    Type of the object.

    System.Object existingValue

    The existing value of object being read.

    JsonSerializerReader internalReader
    Returns
    Type Description
    System.Object

    The object value.

    Overrides
    JsonConverter.ReadJson(JsonReader, Type, Object, JsonSerializerReader)
    | Improve this Doc View Source

    WriteJson(JsonWriter, Object, JsonSerializerWriter)

    Writes the JSON representation of the object.

    Declaration
    public override void WriteJson(JsonWriter writer, object value, JsonSerializerWriter internalWriter)
    Parameters
    Type Name Description
    JsonWriter writer

    The JsonWriter to write to.

    System.Object value

    The value.

    JsonSerializerWriter internalWriter
    Overrides
    JsonConverter.WriteJson(JsonWriter, Object, JsonSerializerWriter)