Table of Contents

Namespace DynaSharp.Serialization

Classes

ConverterChecks

The checks every converter makes before it reads a value. Converters and the code the source generator emits call them, so a wrong type is reported the same way everywhere.

Structs

ArrayConverter<T, TConverter>

Converts T[] to and from a list value (L), each element in the form of TConverter.

AttributeValueConverter

Converts AttributeValue to and from any DynamoDB attribute value: the converter for a property that holds a value of unknown or varying type, and for the values of the untyped API.

BinaryConverter

Converts byte[] to and from a binary value (B), which travels as base64.

BinarySetElement

The elements of a binary set (BS): byte[], as base64.

BoolAsNumberConverter

Converts bool to and from a number value (N): true as {"N":"1"} and false as {"N":"0"}, the form DynamoDBContext of the AWS SDK for .NET stores in its default conversion, V1. It is opt-in, with [DynamoDbConverter] on the property or [assembly: DynamoDbDefaultConverter(typeof(bool), typeof(BoolAsNumberConverter))], since a bool is a boolean value (BOOL) by default.

BoolConverter

Converts bool to and from a boolean value (BOOL).

DateOnlyConverter

Converts DateOnly to and from a string value (S) in the form 2026-10-31, which orders chronologically as text.

DateTimeConverter

Converts DateTime to and from a string value (S) holding the instant in UTC in the round-trip form 2026-10-31T12:00:00.0000000Z, the form DateTimeOffsetConverter writes, so both kinds of properties compare in one order.

DateTimeOffsetConverter

Converts DateTimeOffset to and from a string value (S) holding the instant in UTC in the round-trip form 2026-10-31T12:00:00.0000000Z: always seven fraction digits, always Z.

DictionaryConverter<T, TConverter>

Converts Dictionary<TKey, TValue> with string keys to and from a map value (M), each value in the form of TConverter.

DocumentConverter<T>

Converts a mapped document or entity to and from a map value (M), which is how a type nests in another: an address in a customer, or the lines of an order through ListConverter<T, TConverter>. The attributes are the ones T writes as an item of its own.

DynamoDbReader

Reads DynamoDB JSON: attribute values in their typed form, such as {"S":"abc"}, and items, which are JSON objects that map attribute names to attribute values.

DynamoDbWriter

Writes DynamoDB JSON: attribute values in their typed form, such as {"S":"abc"} or {"N":"42"}, and items, which are JSON objects that map attribute names to attribute values.

EmptyStringAsMissingConverter<T, TConverter>

Reads and writes what TConverter does, and counts a stored empty string, {"S":""}, as if the attribute were not in the item, on top of what TConverter counts. It is for a table where other code wrote "" for no value, into an attribute whose converter cannot read it: [DynamoDbConverter(typeof(EmptyStringAsMissingConverter<DateTimeOffset, DateTimeOffsetConverter>))] public DateTimeOffset? ShippedAt { get; init; } reads {"S":""} as null, and {"S":"2026-10-31T12:00:00.0000000Z"} as that instant.

EpochSecondsConverter

Converts DateTimeOffset to and from a number value (N) of whole seconds since 1970-01-01T00:00:00Z, the form DynamoDB's time to live (TTL) expects. Use it with [DynamoDbConverter] on the property that is the table's TTL attribute.

GuidConverter

Converts Guid to and from a string value (S) in the lowercase 36-character form, 0f8fad5b-d9cb-469f-a165-70867728950e.

GuidSetElement

The elements of a string set (SS) that holds Guid values, each in the form GuidConverter uses.

HashSetConverter<T, TElement>

Converts HashSet<T> to and from a string set, number set or binary set, as TElement says.

JsonElementConverter

Converts JsonElement to and from the native DynamoDB value that holds the same JSON: an object is a map (M), an array a list (L), a string S, a number N with its digits as written, true and false BOOL, and null NULL. It is the built-in converter of a property of type JsonElement, so a document whose schema belongs to someone else, such as the payload of an event, is stored as a map that filters, projections and updates reach by path.

ListConverter<T, TConverter>

Converts List<T> to and from a list value (L), each element in the form of TConverter.

MutableListConverter<T, TConverter>

Converts IList<T> to and from a list value (L), each element in the form of TConverter.

NullableConverter<T, TConverter>

Converts T? for a value type T: the value in the form of TConverter, or the null value {"NULL":true}.

NullableReferenceConverter<T, TConverter>

Converts T? for a reference type T: the value in the form of TConverter, or the null value {"NULL":true}.

NumberConverter<T>

Converts any .NET number type to and from a number value (N): integers, decimal, double, float, Half, Int128, UInt128 and BigInteger.

NumberSetElement<T>

The elements of a number set (NS): any .NET number type, formatted and parsed as NumberConverter<T> does.

OffsetTimestampConverter

Converts DateTimeOffset to and from a string value (S) that keeps the offset, in the round-trip form 2026-11-20T11:00:00.0000000+01:00: always seven fraction digits, always an offset, +00:00 for UTC. It is opt-in, with [DynamoDbConverter] on the property or [assembly: DynamoDbDefaultConverter(typeof(DateTimeOffset), typeof(OffsetTimestampConverter))], since DateTimeOffsetConverter stores the instant in UTC.

ReadOnlyDictionaryConverter<T, TConverter>

Converts IReadOnlyDictionary<TKey, TValue> with string keys to and from a map value (M), each value in the form of TConverter.

ReadOnlyListConverter<T, TConverter>

Converts IReadOnlyList<T> to and from a list value (L), each element in the form of TConverter.

ReadOnlyMemoryConverter

Converts ReadOnlyMemory<T> of byte to and from a binary value (B), which travels as base64.

ReadOnlySetConverter<T, TElement>

Converts IReadOnlySet<T> to and from a string set, number set or binary set, as TElement says.

SdkDateTimeConverter

Converts DateTime to and from a string value (S) in the form DynamoDBContext of the AWS SDK for .NET stores: the instant in UTC with three fraction digits, 2026-10-31T12:00:00.123Z. It is opt-in, with [DynamoDbConverter] on the property or [assembly: DynamoDbDefaultConverter(typeof(DateTime), typeof(SdkDateTimeConverter))], for a table the SDK wrote, where DateTimeConverter would write seven digits, 2026-10-31T12:00:00.1230000Z, which an equality condition and a key built from an old value no longer match.

SetArrayConverter<T, TElement>

Converts T[] to and from a string set, number set or binary set, as TElement says. It is opt-in, with [DynamoDbConverter] on the property, since an array is a list by default.

StringConverter

Converts string to and from a string value (S).

StringSetElement

The elements of a string set (SS): string.

TimeOnlyConverter

Converts TimeOnly to and from a string value (S) in the form 12:00:00.0000000: 24-hour clock, always seven fraction digits, so the text orders like the time.

TimeSpanConverter

Converts TimeSpan to and from a string value (S) in the constant format [-][d.]hh:mm:ss[.fffffff], for example 1.02:03:04.5000000.

Interfaces

IAddableConverter

Marks the converter of a number or a set, the only types that the ADD action of an update takes. A typed Add requires it, so adding to a handle of a string is a compile error rather than a ValidationException. Implement it on a custom converter that writes a number (N) or a set.

IDynamoDbConverter<T>

Converts values of type T to and from DynamoDB attribute values.

IDynamoDbSetElementConverter<T>

Converts the elements of a DynamoDB set. The elements of a set have no type descriptor of their own: the set as a whole is a string set (SS), number set (NS) or binary set (BS), and each element is a plain JSON string.