Class JsonCollectionItemConverter<TDatatype, TConverterType>
Json collection converter.
Inheritance
JsonConverter<IEnumerable<TDatatype>>
JsonCollectionItemConverter<TDatatype, TConverterType>
Namespace: Neon.Kube.Resources.JsonConverters
Assembly: Neon.Kube.Resources.dll
Syntax
public class JsonCollectionItemConverter<TDatatype, TConverterType> : JsonConverter<IEnumerable<TDatatype>> where TConverterType : JsonConverter
Type Parameters
Name | Description |
---|---|
TDatatype | Type of item to convert. |
TConverterType | Converter to use for individual items. |
Methods
CanConvert(Type)
Determines whether the specified type can be converted.
Declaration
public override bool CanConvert(Type objectType)
Parameters
Type | Name | Description |
---|---|---|
Type | objectType |
Returns
Type | Description |
---|---|
bool |
Overrides
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type System.Collections.Generic.IEnumerable{`0}.
Declaration
public override IEnumerable<TDatatype> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonReader | reader | The reader. |
Type | typeToConvert | The type to convert. |
JsonSerializerOptions | options | An object that specifies serialization options to use. |
Returns
Type | Description |
---|---|
IEnumerable<TDatatype> | The converted value. |
Overrides
Write(Utf8JsonWriter, IEnumerable<TDatatype>, JsonSerializerOptions)
Writes a specified value as JSON.
Declaration
public override void Write(Utf8JsonWriter writer, IEnumerable<TDatatype> value, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonWriter | writer | The writer to write to. |
IEnumerable<TDatatype> | value | The value to convert to JSON. |
JsonSerializerOptions | options | An object that specifies serialization options to use. |