Table of Contents

Interface IDynamoDbEntity<TSelf>

Namespace
DynaSharp.Mapping
Assembly
DynaSharp.dll

A document with a primary key, which is what can stand on its own in a table. A nested document such as an address has no key, so it implements IDynamoDbDocument<TSelf> only, and Of<TOther>() and Table<T>(string) do not take it.

public interface IDynamoDbEntity<TSelf> : IDynamoDbDocument<TSelf> where TSelf : IDynamoDbEntity<TSelf>

Type Parameters

TSelf

The implementing type.

Inherited Members

Properties

Info

Gets what the type knows about its table: key names, indexes, discriminator and version attribute.

public static abstract DynamoDbEntityInfo Info { get; }

Property Value

DynamoDbEntityInfo

Methods

ReadVersion(TSelf)

Gets the version the entity holds, for a delete that takes it from the entity. The generator implements this for a type with a VersionAttribute; a type written by hand that names a version attribute in its DynaSharp.Mapping.DynamoDbEntityInfo implements it too.

public static long ReadVersion(TSelf entity)

Parameters

entity TSelf

The entity.

Returns

long

The version.

Exceptions

NotSupportedException

The type does not implement this.

OverflowException

The version does not fit a long.

WriteKey(DynamoDbWriter, TSelf)

Writes the primary key attributes, without the surrounding braces.

public static abstract void WriteKey(DynamoDbWriter writer, TSelf entity)

Parameters

writer DynamoDbWriter

The writer, positioned inside a Key object.

entity TSelf

The entity to take the key from.