ISqlStorageProvider Interface
Root interface for SQL-based storage providers, supporting execution of parameterless SQL statements.
public interface ISqlStorageProvider : HAKOM.Persistence.Core.Net.Api.Storage.IStorageProviderDerived
↳ ISqlStorageProvider<TParameter,TParameterFactory,TReader>
↳ ISqlStorageProvider<TReader>
↳ SqlStorageProvider<TConnection,TCommand,TNativeParameter,TReader,TParameter,TParameterFactory>
Implements IStorageProvider
Remarks
Section titled “Remarks”Follows the Try/Result pattern: TryExecute(string, CancellationToken) returns a Result<TValue> and never throws, while Execute(string, CancellationToken) is the throwing convenience wrapper.
Methods
Section titled “Methods”ISqlStorageProvider.Execute(string, CancellationToken) Method
Section titled “ISqlStorageProvider.Execute(string, CancellationToken) Method”Executes the specified SQL statement and returns the number of affected rows.
System.Threading.Tasks.Task<int> Execute(string sql, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”sql System.String
The SQL statement to execute.
cancellationToken System.Threading.CancellationToken
Propagates notification that the operation should be canceled.
Returns
Section titled “Returns”System.Threading.Tasks.Task<System.Int32>
The number of rows affected by the statement.
ISqlStorageProvider.TryExecute(string, CancellationToken) Method
Section titled “ISqlStorageProvider.TryExecute(string, CancellationToken) Method”Attempts to execute the specified SQL statement and returns a Result<TValue> containing the number of affected rows or an error.
System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<int>> TryExecute(string sql, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”sql System.String
The SQL statement to execute.
cancellationToken System.Threading.CancellationToken
Propagates notification that the operation should be canceled.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<System.Int32>>
A Result<TValue> with the number of affected rows on success, or an error on failure.