Table of Contents

Interface IDynamoDbSetElementConverter<T>

Namespace
DynaSharp.Serialization
Assembly
DynaSharp.dll

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.

public interface IDynamoDbSetElementConverter<T>

Type Parameters

T

The .NET type of the elements.

Remarks

Pass an implementation to HashSetConverter<T, TElement>, ReadOnlySetConverter<T, TElement> or SetArrayConverter<T, TElement>. The built-in ones are StringSetElement, NumberSetElement<T>, BinarySetElement and GuidSetElement. Implement it on a struct, for example to store an enumeration by name in a string set.

Properties

SetType

Gets the kind of set the elements belong to: StringSet, NumberSet or BinarySet.

public static abstract AttributeType SetType { get; }

Property Value

AttributeType

Methods

ReadElement(ref DynamoDbReader)

Reads the element the reader is positioned on, with the reader's getter for SetType. Reads nothing beyond the element.

public static abstract T ReadElement(ref DynamoDbReader reader)

Parameters

reader DynamoDbReader

The reader, positioned on an element after TryReadSetElement() returned true.

Returns

T

The element.

WriteElement(DynamoDbWriter, T)

Writes one element, with the writer's Write...SetElement method for SetType.

public static abstract void WriteElement(DynamoDbWriter writer, T value)

Parameters

writer DynamoDbWriter

The writer, inside a set that SetType started.

value T

The element.