Interface ITableRepository
Interface representing a repository for interacting with a table.
Inherited Members
Namespace: Innovt.Cloud.Table
Assembly: Innovt.Cloud.dll
Syntax
public interface ITableRepository : IDisposable
Methods
| Edit this page View SourceAddAsync<T>(T, CancellationToken)
Asynchronously adds a single item to the repository.
Declaration
Task AddAsync<T>(T message, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
T | message | The item to add. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous add operation. |
Type Parameters
Name | Description |
---|---|
T | The type of item to add. |
AddRangeAsync<T>(ICollection<T>, CancellationToken)
Asynchronously adds multiple items to the repository.
Declaration
Task AddRangeAsync<T>(ICollection<T> messages, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | messages | The list of items to add. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous add operation. |
Type Parameters
Name | Description |
---|---|
T | The type of items to add. |
BatchGetItem<T>(BatchGetItemRequest, CancellationToken)
Asynchronously retrieves multiple items in a batch.
Declaration
Task<List<T>> BatchGetItem<T>(BatchGetItemRequest batchGetItemRequest, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
BatchGetItemRequest | batchGetItemRequest | The batch get item request. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<List<T>> | A list of items of type T. |
Type Parameters
Name | Description |
---|---|
T | The type of items to retrieve. |
BatchWriteItem(BatchWriteItemRequest, CancellationToken)
Asynchronously performs a batch write operation.
Declaration
Task<BatchWriteItemResponse> BatchWriteItem(BatchWriteItemRequest batchWriteItemRequest, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
BatchWriteItemRequest | batchWriteItemRequest | The batch write item request. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<BatchWriteItemResponse> | A response from the batch write operation. |
CreateTransactionWriteItem<T>(T, TransactionWriteOperationType)
Create a transaction write item based on the instance.
Declaration
TransactionWriteItem CreateTransactionWriteItem<T>(T instance, TransactionWriteOperationType operationType = TransactionWriteOperationType.Put) where T : class, new()
Parameters
Type | Name | Description |
---|---|---|
T | instance | A mapped instance with context. |
TransactionWriteOperationType | operationType | The operation that you want to perform. |
Returns
Type | Description |
---|---|
TransactionWriteItem | A incomplete transaction write item with properties mapped. |
Type Parameters
Name | Description |
---|---|
T | A typed mapped entity |
DeleteAsync<T>(object, string, CancellationToken)
Asynchronously deletes an item using its identifier and optional range key.
Declaration
Task DeleteAsync<T>(object id, string rangeKey = null, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
object | id | The identifier of the item. |
string | rangeKey | The range key for the item (optional). |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous delete operation. |
Type Parameters
Name | Description |
---|---|
T | The type of item to delete. |
DeleteAsync<T>(T, CancellationToken)
Asynchronously deletes an item using its value.
Declaration
Task DeleteAsync<T>(T message, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
T | message | The item to delete. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous delete operation. |
Type Parameters
Name | Description |
---|---|
T | The type of item to delete. |
DeleteRangeAsync<T>(ICollection<T>, CancellationToken)
Asynchronously a list of item that are from the same type.
Declaration
Task DeleteRangeAsync<T>(ICollection<T> messages, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | messages | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
T |
ExecuteStatementAsync<T>(ExecuteSqlStatementRequest, CancellationToken)
Executes an SQL statement asynchronously and retrieves the results.
Declaration
Task<ExecuteSqlStatementResponse<T>> ExecuteStatementAsync<T>(ExecuteSqlStatementRequest sqlStatementRequest, CancellationToken cancellationToken = default) where T : class, new()
Parameters
Type | Name | Description |
---|---|---|
ExecuteSqlStatementRequest | sqlStatementRequest | The SQL statement request. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<ExecuteSqlStatementResponse<T>> | A response containing the results of the SQL statement execution. |
Type Parameters
Name | Description |
---|---|
T | The type of results to expect. |
GetByIdAsync<T>(object, string?, CancellationToken)
Asynchronously retrieves an item by its identifier.
Declaration
Task<T?> GetByIdAsync<T>(object id, string? rangeKey = null, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
object | id | The identifier of the item. |
string | rangeKey | The range key for the item (optional). |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<T> | An item of type T if found; otherwise, null. |
Type Parameters
Name | Description |
---|---|
T | The type of item to retrieve. |
QueryAsync<T>(QueryRequest, CancellationToken)
Asynchronously queries and retrieves a list of items of type T based on the provided query request.
Declaration
Task<IList<T>> QueryAsync<T>(QueryRequest request, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
QueryRequest | request | The query request specifying the query parameters. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IList<T>> | A list of items of type T based on the query request. |
Type Parameters
Name | Description |
---|---|
T | The type of items to retrieve. |
QueryAsync<T>(object, CancellationToken)
Asynchronously queries and retrieves a list of items of type T by their identifier.
Declaration
Task<IList<T>> QueryAsync<T>(object id, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
object | id | The identifier of the items. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IList<T>> | A list of items of type T. |
Type Parameters
Name | Description |
---|---|
T | The type of items to retrieve. |
QueryFirstAsync<T>(object, CancellationToken)
Asynchronously queries and retrieves the first item of type T by its identifier.
Declaration
Task<T?> QueryFirstAsync<T>(object id, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
object | id | The identifier of the item. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<T> | An item of type T if found; otherwise, null. |
Type Parameters
Name | Description |
---|---|
T | The type of item to retrieve. |
QueryFirstOrDefaultAsync<T>(QueryRequest, CancellationToken)
Asynchronously queries and retrieves the first item of type T based on the provided query request.
Declaration
Task<T?> QueryFirstOrDefaultAsync<T>(QueryRequest request, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
QueryRequest | request | The query request specifying the query parameters. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<T> | The first item of type T based on the query request; otherwise, null. |
Type Parameters
Name | Description |
---|---|
T | The type of item to retrieve. |
QueryMultipleAsync<T, TResult1, TResult2>(QueryRequest, string, CancellationToken)
Asynchronously queries and retrieves multiple sets of results from a single query.
Declaration
Task<(IList<TResult1> first, IList<TResult2> second)> QueryMultipleAsync<T, TResult1, TResult2>(QueryRequest request, string splitBy, CancellationToken cancellationToken = default) where T : class where TResult1 : class where TResult2 : class
Parameters
Type | Name | Description |
---|---|---|
QueryRequest | request | The query request. |
string | splitBy | The parameter to split the results by. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<(IList<TResult1> first, IList<TResult2> second)> | Tuple containing the first and second result sets. |
Type Parameters
Name | Description |
---|---|
T | The type of items to retrieve. |
TResult1 | The type of the first result set. |
TResult2 | The type of the second result set. |
QueryMultipleAsync<T, TResult1, TResult2, TResult3>(QueryRequest, string[], CancellationToken)
Asynchronously queries and retrieves multiple sets of results from a single query.
Declaration
Task<(IList<TResult1> first, IList<TResult2> second, IList<TResult3> third)> QueryMultipleAsync<T, TResult1, TResult2, TResult3>(QueryRequest request, string[] splitBy, CancellationToken cancellationToken = default) where T : class where TResult1 : class where TResult2 : class where TResult3 : class
Parameters
Type | Name | Description |
---|---|---|
QueryRequest | request | The query request specifying the query parameters. |
string[] | splitBy | The parameter to split the results by. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<(IList<TResult1> first, IList<TResult2> second, IList<TResult3> third)> | Tuple containing the first, second, and third result sets. |
Type Parameters
Name | Description |
---|---|
T | The type of items to retrieve. |
TResult1 | The type of the first result set. |
TResult2 | The type of the second result set. |
TResult3 | The type of the third result set. |
QueryMultipleAsync<T, TResult1, TResult2, TResult3, TResult4>(QueryRequest, string[], CancellationToken)
Asynchronously queries and retrieves multiple sets of results from a single query.
Declaration
Task<(IList<TResult1> first, IList<TResult2> second, IList<TResult3> third, IList<TResult4> fourth)> QueryMultipleAsync<T, TResult1, TResult2, TResult3, TResult4>(QueryRequest request, string[] splitBy, CancellationToken cancellationToken = default) where T : class where TResult1 : class where TResult2 : class where TResult3 : class where TResult4 : class
Parameters
Type | Name | Description |
---|---|---|
QueryRequest | request | The query request specifying the query parameters. |
string[] | splitBy | The parameter to split the results by. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<(IList<TResult1> first, IList<TResult2> second, IList<TResult3> third, IList<TResult4> fourth)> | Tuple containing the first, second, third, and fourth result sets. |
Type Parameters
Name | Description |
---|---|
T | The type of items to retrieve. |
TResult1 | The type of the first result set. |
TResult2 | The type of the second result set. |
TResult3 | The type of the third result set. |
TResult4 | The type of the fourth result set. |
QueryMultipleAsync<T, TResult1, TResult2, TResult3, TResult4, TResult5>(QueryRequest, string[], CancellationToken)
Asynchronously queries and retrieves multiple sets of results from a single query.
Declaration
Task<(IList<TResult1> first, IList<TResult2> second, IList<TResult3> third, IList<TResult4> fourth, IList<TResult5> fifth)> QueryMultipleAsync<T, TResult1, TResult2, TResult3, TResult4, TResult5>(QueryRequest request, string[] splitBy, CancellationToken cancellationToken = default) where T : class where TResult1 : class where TResult2 : class where TResult3 : class where TResult4 : class where TResult5 : class
Parameters
Type | Name | Description |
---|---|---|
QueryRequest | request | The query request specifying the query parameters. |
string[] | splitBy | The parameter to split the results by. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<(IList<TResult1> first, IList<TResult2> second, IList<TResult3> third, IList<TResult4> fourth, IList<TResult5> fifth)> | Tuple containing the first, second, third, fourth, and fifth result sets. |
Type Parameters
Name | Description |
---|---|
T | The type of items to retrieve. |
TResult1 | The type of the first result set. |
TResult2 | The type of the second result set. |
TResult3 | The type of the third result set. |
TResult4 | The type of the fourth result set. |
TResult5 | The type of the fifth result set. |
QueryPaginatedByAsync<T>(QueryRequest, CancellationToken)
Asynchronously queries and retrieves a paged collection of items of type T based on the provided query request.
Declaration
Task<PagedCollection<T>> QueryPaginatedByAsync<T>(QueryRequest request, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
QueryRequest | request | The query request specifying the query parameters. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<PagedCollection<T>> | A paged collection of items of type T based on the query request. |
Type Parameters
Name | Description |
---|---|
T | The type of items to retrieve. |
ScanAsync<T>(ScanRequest, CancellationToken)
Asynchronously scans and retrieves a list of items of type T based on the provided scan request.
Declaration
Task<IList<T>> ScanAsync<T>(ScanRequest request, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
ScanRequest | request | The scan request specifying the scan parameters. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IList<T>> | A list of items of type T based on the scan request. |
Type Parameters
Name | Description |
---|---|
T | The type of items to retrieve. |
ScanPaginatedByAsync<T>(ScanRequest, CancellationToken)
Asynchronously scans and retrieves a paged collection of items of type T based on the provided scan request.
Declaration
Task<PagedCollection<T>> ScanPaginatedByAsync<T>(ScanRequest request, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
ScanRequest | request | The scan request specifying the scan parameters. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<PagedCollection<T>> | A paged collection of items of type T based on the scan request. |
Type Parameters
Name | Description |
---|---|
T | The type of items to retrieve. |
TransactWriteItemsAsync(TransactionWriteRequest, CancellationToken)
Asynchronously performs a transactional write of items.
Declaration
Task TransactWriteItemsAsync(TransactionWriteRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
TransactionWriteRequest | request | The transaction write request specifying the items to write. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous transactional write operation. |
UpdateAsync<T>(T, CancellationToken)
This method will perform an update operation on the table. The operation is based on the primary key and type is PUT.
Declaration
Task<T> UpdateAsync<T>(T instance, CancellationToken cancellationToken = default) where T : class, new()
Parameters
Type | Name | Description |
---|---|---|
T | instance | The instance that you want to update |
CancellationToken | cancellationToken | A cancellation token. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T | The instance updated. |