Method Read
- Namespace
- MailFathom.Application.Discovery.Presentation
- Assembly
- MailFathom.Application.dll
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type EmailAddress.
public override EmailAddress Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
readerUtf8JsonReaderThe reader.
typeToConvertTypeThe type to convert.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.
Returns
- EmailAddress
The converted value.
Remarks
The bound is read off the token rather than off the string it decodes to, so an oversized value is refused before anything expands it. That leaves the ceiling marginally stricter for a value written with escapes, which an address has no reason to be.
Exceptions
- JsonException
Thrown when the token is not a string, is longer than MaxOctets, or does not name a usable address.