Table of Contents

Struct NumberSetElement<T>

Namespace
DynaSharp.Serialization
Assembly
DynaSharp.dll

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

public readonly struct NumberSetElement<T> : IDynamoDbSetElementConverter<T> where T : INumberBase<T>

Type Parameters

T

The number type.

Implements
Inherited Members

Remarks

DynamoDB rejects a number set whose elements are numerically equal, so 1 and 1.0 cannot both be in one. A HashSet<T> of decimal holds 1m and 1.0m as one element, since they are equal.

Explicit Interface Implementations

ReadElement(ref DynamoDbReader)

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

static T ReadElement(ref DynamoDbReader reader)

Parameters

reader DynamoDbReader

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

Returns

T

The element.

Exceptions

OverflowException

The number does not fit T, see Read(ref DynamoDbReader, AttributeType).

SetType

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

static AttributeType SetType { get; }

Returns

AttributeType

WriteElement(DynamoDbWriter, T)

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

static void WriteElement(DynamoDbWriter writer, T value)

Parameters

writer DynamoDbWriter

The writer, inside a set that SetType started.

value T

The element.

Exceptions

ArgumentOutOfRangeException

value is NaN or infinite; DynamoDB cannot store either.