JArrayToObjectConverter

Ecng.Serialization

Converts a JSON array to an object of type by mapping array elements to the object's fields in declaration order using compiled IL for performance.

Наследует: JsonConverter

Свойства

CanWrite
public override bool CanWrite { get; }
value = jArrayToObjectConverter.CanWrite

Gets a value indicating whether this converter can write JSON.

Методы

CanConvert
public override bool CanConvert(Type objectType)
result = jArrayToObjectConverter.CanConvert(objectType)

Determines whether this converter can convert the specified object type.

objectType
Type of the object.

Возвращает: Always returns true.

ReadJson
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
result = jArrayToObjectConverter.ReadJson(reader, objectType, existingValue, serializer)

Reads the JSON representation of the object and maps JSON array elements to the corresponding fields of an instance of .

reader
The JSON reader.
objectType
Type of the object.
existingValue
The existing instance of to populate.
serializer
The JSON serializer.

Возвращает: The deserialized object of type .

WriteJson
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
jArrayToObjectConverter.WriteJson(writer, value, serializer)

Writes the object as a JSON array, mapping fields in declaration order.

writer
The JSON writer.
value
The object value.
serializer
The JSON serializer.