ISqlExecutor Interface
.NET Standard 2.x |  Current Version (1.0.1) 
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;
Property
| Name | Return Type | Description | 
|---|---|---|
| DataContext | DataContext | Gets the DataContextobject. | 
Method
| 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) | IEnumerable<TModel> | Executes the SQL SELECT statement and returns an IEnumerable <TModel>object that can be used to load the result set lazily. | 
| SelectLazy<TModel>(ISqlQueryBuilder queryBuilder, params object[] parameters) | IEnumerable<TModel> | Executes the SQL SELECT statement and returns an IEnumerable <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 TModelobject. | 
| SelectOne<TModel>(ISqlQueryBuilder queryBuilder, params object[] parameters) | TModel | Executes the SQL SELECT statement and returns a TModelobject. | 
| SelectProcedure<TModel>(string sqlText, params object[] parameters) | IList<TModel> | Executes a SQL stored procedure and returns an IList<TModel>object. |