Class IpAddressConverter
JSON converter for IPAddress, serializing and deserializing IP addresses as their standard string representation (e.g., "192.168.1.1" or "::1").
public class IpAddressConverter : JsonConverter<IPAddress>
- Inheritance
-
IpAddressConverter
- Inherited Members
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts a JSON string to an IPAddress value.
public override IPAddress Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
readerUtf8JsonReadertypeToConvertTypeoptionsJsonSerializerOptions
Returns
Write(Utf8JsonWriter, IPAddress, JsonSerializerOptions)
Writes an IPAddress value as a JSON string.
public override void Write(Utf8JsonWriter writer, IPAddress value, JsonSerializerOptions options)
Parameters
writerUtf8JsonWritervalueIPAddressoptionsJsonSerializerOptions