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. |
ExecuteProcedure(string sqlText, params object[] parameters) | int | Executes 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. |
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. |
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. |
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. |
SelectProcedure<TModel>(string sqlText, params object[] parameters) | IList<TModel> | Executes a SQL stored procedure and returns an IList<TModel> object. |