Class EventSourceIdJsonConverter<T>

Namespace
Cratis.Chronicle.Events
Assembly
Cratis.Chronicle.dll

Represents a JsonConverter<T> for EventSourceId<T> that serializes the typed value as a plain string for wire compatibility with EventSourceId.

public class EventSourceIdJsonConverter<T> : JsonConverter<EventSourceId<T>> where T : IComparable

Type Parameters

T

The underlying type wrapped by EventSourceId<T>.

Inheritance
EventSourceIdJsonConverter<T>
Inherited Members
Extension Methods

Constructors

EventSourceIdJsonConverter()

public EventSourceIdJsonConverter()

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

public override EventSourceId<T>? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions

Returns

EventSourceId<T>

Write(Utf8JsonWriter, EventSourceId<T>, JsonSerializerOptions)

public override void Write(Utf8JsonWriter writer, EventSourceId<T> value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter
value EventSourceId<T>
options JsonSerializerOptions