Interface IDataRequestExecutor
- Namespace
- Excalibur.Data.Persistence
- Assembly
- Excalibur.Data.Abstractions.dll
Executes an IDataRequest<TConnection, TModel> over an IDbConnection the
provider supplies and owns. Obtain via GetService(Type) with
typeof(IDataRequestExecutor).
public interface IDataRequestExecutor
Remarks
This capability is separate from IPersistenceProvider because the set of providers that can honour it is narrower than the set of providers that exist. Executing a data request this way requires the store to be reachable through an IDbConnection; document, key-value and search stores are not, and have their own execution surfaces — a document store's is IDocumentPersistenceProvider. A provider that cannot honour this contract declines it from GetService(Type) rather than advertising a member that throws.
The connection type is fixed to IDbConnection rather than left open, because the provider — not the caller — decides which connection it opens. A caller-named connection type could only ever agree with the provider's own by coincidence, and disagreeing would be discovered at runtime rather than at compile time.
Methods
ExecuteAsync<TResult>(IDataRequest<IDbConnection, TResult>, CancellationToken)
Executes a data request against a connection opened by this provider, applying the provider's retry policy.
Task<TResult> ExecuteAsync<TResult>(IDataRequest<IDbConnection, TResult> request, CancellationToken cancellationToken)
Parameters
requestIDataRequest<IDbConnection, TResult>The data request to execute.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<TResult>
The result of the data request execution.
Type Parameters
TResultThe type of the result.
Exceptions
- ArgumentNullException
requestis null.- ObjectDisposedException
The provider has been disposed.