Skip to content

Commit

Permalink
Add ExecuteScalarAsync support.
Browse files Browse the repository at this point in the history
  • Loading branch information
sakopov committed Nov 26, 2016
1 parent 1a7a8c7 commit bb9d7ab
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions source/Dapper.AmbientContext/IAmbientDbContextQueryProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,86 @@ namespace Dapper.AmbientContext
/// </summary>
public interface IAmbientDbContextQueryProxy
{
/// <summary>
/// Execute parameterized SQL that selects a single value asynchronously using
/// .NET 4.5 <see cref="System.Threading.Tasks.Task"/>.
/// </summary>
/// <param name="sql">
/// The SQL statement to execute.
/// </param>
/// <param name="param">
/// The SQL query parameters.
/// </param>
/// <param name="commandTimeout">
/// The number of seconds before command execution timeout.
/// </param>
/// <param name="commandType">
/// Determines whether the command is a stored procedure or a batch.
/// </param>
/// <returns>
/// The first cell selected.
/// </returns>
Task<object> ExecuteScalarAsync(
string sql,
object param = null,
int? commandTimeout = null,
CommandType? commandType = null);

/// <summary>
/// Execute parameterized SQL that selects a single value asynchronously using
/// .NET 4.5 <see cref="System.Threading.Tasks.Task"/>.
/// </summary>
/// <typeparam name="T">
/// The return type.
/// </typeparam>
/// <param name="sql">
/// The SQL statement to execute.
/// </param>
/// <param name="param">
/// The SQL query parameters.
/// </param>
/// <param name="commandTimeout">
/// The number of seconds before command execution timeout.
/// </param>
/// <param name="commandType">
/// Determines whether the command is a stored procedure or a batch.
/// </param>
/// <returns>
/// The first cell selected.
/// </returns>
Task<T> ExecuteScalarAsync<T>(
string sql,
object param = null,
int? commandTimeout = null,
CommandType? commandType = null);

/// <summary>
/// Execute parameterized SQL that selects a single value asynchronously using
/// .NET 4.5 <see cref="System.Threading.Tasks.Task"/>.
/// </summary>
/// <param name="command">
/// The SQL command definition.
/// </param>
/// <returns>
/// The first cell selected.
/// </returns>
Task<object> ExecuteScalarAsync(CommandDefinition command);

/// <summary>
/// Execute parameterized SQL that selects a single value asynchronously using
/// .NET 4.5 <see cref="System.Threading.Tasks.Task"/>.
/// </summary>
/// <typeparam name="T">
/// The return type.
/// </typeparam>
/// <param name="command">
/// The SQL command definition.
/// </param>
/// <returns>
/// The first cell selected.
/// </returns>
Task<T> ExecuteScalarAsync<T>(CommandDefinition command);

/// <summary>
/// Execute a query asynchronously using .NET 4.5 <see cref="System.Threading.Tasks.Task"/>.
/// </summary>
Expand Down

0 comments on commit bb9d7ab

Please sign in to comment.