SimCardJsonConverter Class

Converter for SimCardNumbers (to convert them to Json and back)

Definition

Namespace: MobileTrack.Common.Services.JsonConverters.Generics
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+45c8d9adb5970d727cceec44a5ed61aea0016e50
internal sealed class SimCardJsonConverter : JsonConverter<SimCardNumber>
Inheritance
Object    JsonConverter    JsonConverterSimCardNumber    SimCardJsonConverter

Remarks

Because System.Text.Json does not support UInt128 inside converters, we use a value span and raw value to force-serialize it as a number. If, eventually, we get support for UInt128 and Int128 usage, we'll use the regular serialization.

Constructors

SimCardJsonConverterInitializes a new instance of the SimCardJsonConverter class

Methods

ReadReads and converts the JSON to type T.
(Overrides JsonConverterTRead(Utf8JsonReader, Type, JsonSerializerOptions))
WriteWrites a specified value as JSON.
(Overrides JsonConverterTWrite(Utf8JsonWriter, T, JsonSerializerOptions))

See Also