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

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

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