/// <summary>
 /// Executes a query, returning the data typed as per <typeparamref name="T"/>.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static IEnumerable <T> QueryScript <T>(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return(connection.Query <T>(command.ToSqlDefinition(scripts)));
 }
 /// <summary>
 /// Executes a single-row query, returning the data typed as per <typeparamref name="T"/>.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static T QuerySingleScript <T>(this ISqlScriptConnection connection, ScriptCommandDefinition command)
 {
     return(connection.QuerySingle <T>(command.ToSqlDefinition(connection)));
 }
 /// <summary>
 /// Execute a parameterized SQL script that returns a single value.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static T ExecuteScalarScript <T>(this ISqlScriptConnection connection, ScriptCommandDefinition command)
 {
     return(connection.ExecuteScalar <T>(command.ToSqlDefinition(connection)));
 }
 /// <summary>
 /// Execute a parameterized SQL script.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static int ExecuteScript(this ISqlScriptConnection connection, ScriptCommandDefinition command)
 {
     return(connection.Execute(command.ToSqlDefinition(connection)));
 }
 /// <summary>
 /// Executes a single-row query, returning the data typed as per <typeparamref name="T"/>.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static T QueryFirstOrDefaultScript <T>(this ISqlScriptConnection connection, ScriptCommandDefinition command)
 {
     return(connection.QueryFirstOrDefault <T>(command.ToSqlDefinition(connection)));
 }
 /// <summary>
 /// Execute a parameterized SQL script and return an <seealso cref="IDataReader"/>.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static IDataReader ExecuteReaderScript(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return(connection.ExecuteReader(command.ToSqlDefinition(scripts)));
 }
 /// <summary>
 /// Execute a single-row SQL script query asynchronously using Task.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task <dynamic> QuerySingleScriptAsync(this ISqlScriptConnection connection, ScriptCommandDefinition command)
 {
     return(await connection.QuerySingleAsync(command.ToSqlDefinition(connection)));
 }
Пример #8
0
 /// <summary>
 /// Execute a single-row SQL script query asynchronously using Task.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task<dynamic> QuerySingleScriptAsync(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return await connection.QuerySingleAsync(command.ToSqlDefinition(scripts));
 }
Пример #9
0
 /// <summary>
 /// Execute a single-row SQL script query asynchronously using Task.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task<T> QuerySingleOrDefaultScriptAsync<T>(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return await connection.QuerySingleOrDefaultAsync<T>(command.ToSqlDefinition(scripts));
 }
Пример #10
0
 /// <summary>
 /// Execute a SQL script query asynchronously using Task.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task<IEnumerable<T>> QueryScriptAsync<T>(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return await connection.QueryAsync<T>(command.ToSqlDefinition(scripts));
 }
Пример #11
0
 /// <summary>
 /// Execute a SQL script that returns multiple result sets, and access each in turn.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task<SqlMapper.GridReader> QueryMultipleScriptAsync(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return await connection.QueryMultipleAsync(command.ToSqlDefinition(scripts));
 }
 /// <summary>
 /// Execute a parameterized SQL script asynchronously that selects a single value.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task <T> ExecuteScalarScriptAsync <T>(this ISqlScriptConnection connection, ScriptCommandDefinition command)
 {
     return(await connection.ExecuteScalarAsync <T>(command.ToSqlDefinition(connection)));
 }
 /// <summary>
 /// Execute a parameterized SQL script asynchronously and return an <seealso cref="IDataReader"/>.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task <IDataReader> ExecuteReaderScriptAsync(this ISqlScriptConnection connection, ScriptCommandDefinition command)
 {
     return(await connection.ExecuteReaderAsync(command.ToSqlDefinition(connection)));
 }
 /// <summary>
 /// Execute a single-row SQL script query asynchronously using Task.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task <T> QuerySingleOrDefaultScriptAsync <T>(this ISqlScriptConnection connection, ScriptCommandDefinition command)
 {
     return(await connection.QuerySingleOrDefaultAsync <T>(command.ToSqlDefinition(connection)));
 }
 /// <summary>
 /// Execute a command that returns multiple result sets, and access each in turn.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static SqlMapper.GridReader QueryMultipleScript(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return(connection.QueryMultiple(command.ToSqlDefinition(scripts)));
 }
Пример #16
0
 /// <summary>
 /// Execute a parameterized SQL script asynchronously and return an <seealso cref="IDataReader"/>.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task<IDataReader> ExecuteReaderScriptAsync(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return await connection.ExecuteReaderAsync(command.ToSqlDefinition(scripts));
 }
 /// <summary>
 /// Executes a single-row query, returning the data typed as per <typeparamref name="T"/>.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static T QuerySingleOrDefaultScript <T>(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return(connection.QuerySingleOrDefault <T>(command.ToSqlDefinition(scripts)));
 }
Пример #18
0
 /// <summary>
 /// Execute a parameterized SQL script asynchronously that selects a single value.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task<object> ExecuteScalarScriptAsync(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return await connection.ExecuteScalarAsync(command.ToSqlDefinition(scripts));
 }
 /// <summary>
 /// Execute a parameterized SQL script that returns a single value.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="scripts">The collection of scripts used to populate the commands SQL text.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static object ExecuteScalarScript(this DbConnection connection, ISqlScriptCollection scripts, ScriptCommandDefinition command)
 {
     return(connection.ExecuteScalar(command.ToSqlDefinition(scripts)));
 }
 /// <summary>
 /// Execute a SQL script query asynchronously using Task.
 /// </summary>
 /// <param name="connection">The database connection.</param>
 /// <param name="command">The command to execute on this connection.</param>
 public static async Task <IEnumerable <T> > QueryScriptAsync <T>(this ISqlScriptConnection connection, ScriptCommandDefinition command)
 {
     return(await connection.QueryAsync <T>(command.ToSqlDefinition(connection)));
 }