Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public static object ExecuteScalarInterceptor(this IDbCommand cmd)
        {
            var interceptor = new DbCommandInterceptor(cmd);
            var result      = cmd.ExecuteScalar();

            interceptor.Complete();
            return(result);
        }
Exemplo n.º 3
0
        public static IDataReader ExecuteReaderInterceptor(this IDbCommand cmd, CommandBehavior behavior)
        {
            var interceptor = new DbCommandInterceptor(cmd);
            var result      = cmd.ExecuteReader(behavior);

            interceptor.Complete();
            return(result);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        public static int ExecuteNonQueryInterceptor(this IDbCommand cmd)
        {
            var interceptor = new DbCommandInterceptor(cmd);
            var result      = cmd.ExecuteNonQuery();

            interceptor.Complete();
            return(result);
        }