Struct GetSelectCommand<TValue, TConverter>
- Namespace
- DynaSharp
- Assembly
- DynaSharp.dll
A GetItem of one attribute, as Select<TValue, TConverter>(Attr<TValue, TConverter>) leaves it. Nothing can be added any more, which the type enforces, so
Consistent and the other clauses come before Select: all that is left is to send it. See GetCommand<T> for what a command is and what it cannot do.
public readonly ref struct GetSelectCommand<TValue, TConverter> where TConverter : IDynamoDbConverter<TValue>
Type Parameters
TValueThe type of the attribute, nullable for a handle of a nullable property.
TConverterThe converter that reads it.
- Inherited Members
Methods
SendAsync(CancellationToken)
Sends the command. An item that does not exist is not an error: Found is false, also for a handle that cannot be null. An attribute that the item does not have follows the type of the handle: null for a nullable one, an empty set for a set, and otherwise a DynamoDbMappingException.
public ValueTask<SelectResult<TValue>> SendAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels the call.
Returns
- ValueTask<SelectResult<TValue>>
The result. Await it once.
Exceptions
- InvalidOperationException
The command was already sent or rendered.
- ObjectDisposedException
The client is disposed.
- ValidationException
DynamoDB rejects the request, for example because the key does not fit the table.
- ResourceNotFoundException
The table does not exist.
- DynamoDbMappingException
The item has no such attribute and the handle cannot be null, the value cannot be read as
TValue, or the item is of another type.- 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. It shows what goes out: the attribute, and the discriminator if the entity has one. The text contains the key.
public string ToRequestJson()
Returns
- string
The request body.
Exceptions
- InvalidOperationException
The command was already sent or rendered.