Table of Contents

Class StoredEmailIdJsonConverter

Namespace
MailFathom.Application.Discovery.Presentation.Citations
Assembly
MailFathom.Application.dll

Serializes StoredEmailId as the bare UUID the client API already names an email by.

public sealed class StoredEmailIdJsonConverter : JsonConverter<StoredEmailId>
Inheritance
StoredEmailIdJsonConverter
Inherited Members

Remarks

The converter is declared here and applied where the citation contract uses the identity, rather than on the domain type itself. A stored-email identifier is not a wire concept — it is a local identity that happens to be what this contract cites — and putting a serialization decision on the domain type would settle it for every other boundary that ever meets one. Without it the identifier would be written as the object its property list describes, which is neither what the client API publishes today nor anything a reader would recognize.

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type StoredEmailId.

Write(Utf8JsonWriter, StoredEmailId, JsonSerializerOptions)

Writes a specified value as JSON.