ISqlExecutor Interface
.NET Standard 2.x
The ISqlExecutor
interface represents a SqlExecutor
object. SqlExecutor provides a set of database manipulation interfaces that have encapsulated the core components of ADO.NET. Using SqlExecutor you can directly run dynamic SQL statements, perform SqlBuilder functions, and do model queries.
SqlExecutor supports raw SQL as well as automatic SQL generation, supports lazy loading of data to prevent unnecessary performance bottlenecks, and can bind result-sets to POCO or dynamic models.
Namespace: SnapObjects.Data
Assembly: SnapObjects.Data.dll
Syntax
public interface ISqlExecutor;
Properties
Name | Return Type | Description |
---|---|---|
DataContext | DataContext | Gets the DataContext object. |
Methods
Name | Return Type | Description |
---|---|---|
Execute(string sqlText, params object[] parameters) | int | Executes the SQL statements like UPDATE, INSERT, DELETE etc. |
ExecuteAsync(string sqlText, params object[] parameters) | Task<int> | Asynchronously executes the SQL statements like UPDATE, INSERT, DELETE, etc. |
ExecuteAsync(string sqlText, object[] parameters, CancellationToken cancellationToken) | Task<int> | Asynchronously executes the SQL statements like UPDATE, INSERT, DELETE, etc. |
ExecuteProcedure(string procedureName, params object[] parameters) | int | Executes a stored procedure. |
ExecuteProcedureAsync(string procedureName, params object[] parameters) | Task<int> | Asynchronously execute a stored procedure. |
ExecuteProcedureAsync(string procedureName, object[] parameters, CancellationToken cancellationToken) | Task<int> | Asynchronously execute a stored procedure. |
Scalar<TValue>(string sqlText, params object[] parameters) | TValue | Executes the SQL SELECT statement and returns the first column of the first row in the result set. |
Scalar<TValue>(ISqlQueryBuilder sqlQueryBuilder, params object[] parameters) | TValue | Executes the SQL SELECT statement and returns the first column of the first row in the result set. |
ScalarAsync<TValue>(sqlText, params object[] parameters) | Task<TValue> | Asynchronously executes the SQL SELECT statement and returns the first column of the first row in the result set. All other columns and rows are ignored. |
ScalarAsync<TValue>(string sqlText, object[] parameters, CancellationToken cancellationToken) | Task<TValue> | Asynchronously executes the SQL SELECT statement and returns the first column of the first row in the result set. All other columns and rows are ignored. |
ScalarAsync<TValue>(ISqlQueryBuilder sqlQueryBuilder, params object[] parameters) | Task<TValue> | Asynchronously executes the SQL SELECT statement created by an ISqlQueryBuilder object and returns the first column of the first row in the result set. All other columns and rows are ignored. |
ScalarAsync<TValue>(ISqlQueryBuilder sqlQueryBuilder, object[] parameters, CancellationToken cancellationToken) | Task<TValue> | Asynchronously executes the SQL SELECT statement created by an ISqlQueryBuilder object and returns the first column of the first row in the result set. All other columns and rows are ignored. |
Select<TModel>(string sqlText, params object[] parameters) | IList<TModel> | Executes the SQL SELECT statement and returns an IList<TModel> object. |
Select<TModel>(ISqlQueryBuilder queryBuilder, params object[] parameters) | IList<TModel> | Executes the SQL SELECT statement and returns an IList<TModel> object. |
SelectAsync<TModel>(string sqlText, params object[] parameters) | Task<IList<TModel>> | Asynchronously executes the SQL SELECT statement and returns a Task<IList<TModel>> object which represents the result set. |
SelectAsync<TModel>(string sqlText, object[] parameters, CancellationToken cancellationToken) | Task<IList<TModel>> | Asynchronously executes the SQL SELECT statement and returns a Task<IList<TModel>> object which represents the result set. |
SelectAsync<TModel>(ISqlQueryBuilder queryBuilder, params object[] parameters) | Task<IList<TModel>> | Asynchronously executes the SQL SELECT statement generated by an ISqlQueryBuilder object and returns a Task<IList<TModel>> object which represents the result set. |
SelectAsync<TModel>(ISqlQueryBuilder queryBuilder, object[] parameters, CancellationToken cancellationToken) | Task<IList<TModel>> | Asynchronously executes the SQL SELECT statement generated by an ISqlQueryBuilder object and returns a Task<IList<TModel>> object which represents the result set. |
SelectLazy<TModel>(params object[] parameters) | ILazyQueryable<TModel> | Executes the SQL SELECT statement and returns an ILazyQueryable<TModel> object that can be used to load the result set lazily. |
SelectLazy<TModel>(ISqlQueryBuilder queryBuilder, params object[] parameters) | ILazyQueryable<TModel> | Executes the SQL SELECT statement and returns an ILazyQueryable<TModel> object that can be used to load the result set lazily. |
SelectLazyAsync<TModel>(ISqlQueryBuilder queryBuilder, params object[] parameters) | IAsyncEnumerable<TModel> | Asynchronously executes the SQL SELECT statement generated by an ISqlQueryBuilder object and returns an IAsyncEnumerable<TModel> object that can be used to load the result set lazily. |
SelectLazyAsync<TModel>(ISqlQueryBuilder queryBuilder, object[] parameters, CancellationToken cancellationToken) | IAsyncEnumerable<TModel> | Asynchronously executes the SQL SELECT statement generated by an ISqlQueryBuilder object and returns an IAsyncEnumerable<TModel> object that can be used to load the result set lazily. |
SelectLazyAsync<TModel>(string sqlText, params object[] parameters) | IAsyncEnumerable<TModel> | Asynchronously executes the SQL SELECT statement and returns an IAsyncEnumerable<TModel> object that can be used to load the result set lazily. |
SelectLazyAsync<TModel>(string sqlText, object[] parameters, CancellationToken cancellationToken) | IAsyncEnumerable<TModel> | Asynchronously executes the SQL SELECT statement and returns an IAsyncEnumerable<TModel> object that can be used to load the result set lazily. |
SelectOne<TModel>(string sqlText, params object[] parameters) | TModel | Executes the SQL SELECT statement and returns a TModel object. |
SelectOne<TModel>(ISqlQueryBuilder queryBuilder, params object[] parameters) | TModel | Executes the SQL SELECT statement and returns a TModel object. |
SelectOneAsync<TModel>(string sqlText, params object[] parameters) | Task<TModel> | Asynchronously executes the SQL SELECT statement and returns the first row in the result set. All other rows are ignored. |
SelectOneAsync<TModel>(string sqlText, object[] parameters, CancellationToken cancellationToken) | Task<TModel> | Asynchronously executes the SQL SELECT statement and returns the first row in the result set. All other rows are ignored. |
SelectOneAsync<TModel>(ISqlQueryBuilder queryBuilder, params object[] parameters) | Task<TModel> | Asynchronously executes the SQL SELECT statement generated by an ISqlQueryBuilder object and returns the first row in the result set. All other rows are ignored. |
SelectOneAsync<TModel>(ISqlQueryBuilder queryBuilder, object[] parameters, CancellationToken cancellationToken) | Task<TModel> | Asynchronously executes the SQL SELECT statement generated by an ISqlQueryBuilder object and returns the first row in the result set. All other rows are ignored. |
SelectProcedure<TModel>(string procedureName, params object[] parameters) | IList<TModel> | Executes a SQL stored procedure and returns an IList<TModel> object. |
SelectProcedureAsync<TModel>(string procedureName, params object[] parameters) | Task<IList<TModel>> | Asynchronously executes a SQL stored procedure and returns a Task<IList<TModel>> object which represents the result set. |
SelectProcedureAsync<TModel>(string procedureName, object[] parameters, CancellationToken cancellationToken) | Task<IList<TModel>> | Asynchronously executes a SQL stored procedure and returns a Task<IList<TModel>> object which represents the result set. |