public static async Task <object> ExecuteScalarAsyncInterceptor(this DbCommand cmd, CancellationToken cancellationToken) { var interceptor = new DbCommandInterceptor(cmd); var result = await cmd.ExecuteScalarAsync(cancellationToken); interceptor.Complete(); return(result); }
public static object ExecuteScalarInterceptor(this IDbCommand cmd) { var interceptor = new DbCommandInterceptor(cmd); var result = cmd.ExecuteScalar(); interceptor.Complete(); return(result); }
public static IDataReader ExecuteReaderInterceptor(this IDbCommand cmd, CommandBehavior behavior) { var interceptor = new DbCommandInterceptor(cmd); var result = cmd.ExecuteReader(behavior); interceptor.Complete(); return(result); }
public static async Task <DbDataReader> ExecuteReaderAsyncInterceptor(this DbCommand cmd, CommandBehavior behavior, CancellationToken cancellationToken) { var interceptor = new DbCommandInterceptor(cmd); var result = await cmd.ExecuteReaderAsync(behavior, cancellationToken); interceptor.Complete(); return(result); }
public static int ExecuteNonQueryInterceptor(this IDbCommand cmd) { var interceptor = new DbCommandInterceptor(cmd); var result = cmd.ExecuteNonQuery(); interceptor.Complete(); return(result); }