Skip to content

PgIntervalConverter

Namespace: Ankus.Serialization

Assembly: Ankus.Runtime.dll

Writes intervals as session-independent ISO 8601 strings and reads every PostgreSQL interval input form.

public sealed class PgIntervalConverter : JsonConverter<PgInterval>

Writing never requires a backend. The exact ISO 8601 form written here is also read without a backend; other text, including infinity, uses PostgreSQL interval input on the active backend.

Inheritance: object, JsonConverter, JsonConverter<PgInterval>

public PgIntervalConverter()

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Section titled “Read(ref Utf8JsonReader, Type, JsonSerializerOptions)”
public override PgInterval Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters:

reader — Utf8JsonReader

typeToConvert — Type

options — JsonSerializerOptions

Returns: PgInterval

Write(Utf8JsonWriter, PgInterval, JsonSerializerOptions)

Section titled “Write(Utf8JsonWriter, PgInterval, JsonSerializerOptions)”
public override void Write(Utf8JsonWriter writer, PgInterval value, JsonSerializerOptions options)

Parameters:

writer — Utf8JsonWriter

value — PgInterval

options — JsonSerializerOptions