Struct ReturnCommand<TValue, TConverter>
- Namespace
- DynaSharp
- Assembly
- DynaSharp.dll
An update that returns one attribute, as Return<TValue, TConverter>(Attr<TValue, TConverter>) leaves it. Nothing can be added any more, which the type enforces: all that is left is to send it.
public readonly ref struct ReturnCommand<TValue, TConverter> where TConverter : IDynamoDbConverter<TValue>
Type Parameters
TValueThe type of the attribute.
TConverterThe converter.
- Inherited Members
Remarks
The consumed capacity of such an update reaches the capacity metric and no other place: the result is the value.
Methods
SendAsync(CancellationToken)
Sends the command.
public ValueTask<TValue> SendAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels the call.
Returns
- ValueTask<TValue>
The attribute as it is after the update. Await it once.
Exceptions
- InvalidOperationException
The command was already sent, extended or rendered, an entity with a VersionAttribute has neither
IfVersionnorIgnoreVersion, version 0 stands besideIfExistswithout Allow, or a change by handle cannot leave a key consistent, see Set<TValue, TConverter>(Attr<TValue, TConverter>, TValue?).- ObjectDisposedException
The client is disposed.
- DynamoDbMappingException
The response does not hold the attribute, because the update did not change it, or it cannot be read as
TValue. The update has been applied, so it must not simply be repeated.- ConditionalCheckFailedException
A condition did not hold, so nothing was written.
- ValidationException
DynamoDB rejects the request; the exception shows the expressions.
- ResourceNotFoundException
The table does not exist.
- DynamoDbException
DynamoDB returns any other error; a throttling or server error only after the last attempt.
ToRequestJson()
Renders the body this command would send, as DynamoDB JSON, without sending it. It ends the command, and is meant for tests and debugging. The text contains the key and the values.
public string ToRequestJson()
Returns
- string
The request body.
Exceptions
- InvalidOperationException
The command was already sent, extended or rendered.