Exemplo n.º 1
0
        public static IEnumerable <T> Query <T>(this IDbConnection cnn, SQL sql, IDbTransaction transaction = null, bool buffered = true, int?commandTimeout = default(int?), CommandType?commandType = default(CommandType?))
        {
            var strSql = sql.Compile();
            var param  = new DapperParameter(sql.Parameters);

            return(SqlMapper.Query <T>(cnn, strSql, param, transaction, buffered, commandTimeout, commandType));
        }
Exemplo n.º 2
0
        public static async Task <IEnumerable <dynamic> > QueryAsync(this IDbConnection cnn, SQL sql, IDbTransaction transaction = null, int?commandTimeout = default(int?), CommandType?commandType = default(CommandType?))
        {
            var strSql = sql.Compile();
            var param  = new DapperParameter(sql.Parameters);

            return(await SqlMapper.QueryAsync(cnn, strSql, param, transaction, commandTimeout, commandType));
        }
Exemplo n.º 3
0
        public static IDataReader ExcuteReader(this IDbConnection cnn, SQL sql, IDbTransaction transaction = null, int?commandTimeout = default(int?), CommandType?commandType = default(CommandType?))
        {
            var strSql = sql.Compile();
            var param  = new DapperParameter(sql.Parameters);

            return(SqlMapper.ExecuteReader(cnn, strSql, param, transaction, commandTimeout, commandType));
        }
Exemplo n.º 4
0
        public static async Task <T> ExcuteScalarAsync <T>(this IDbConnection cnn, SQL sql, IDbTransaction transaction = null, int?commandTimeout = default(int?), CommandType?commandType = default(CommandType?))
        {
            var strSql = sql.Compile();
            var param  = new DapperParameter(sql.Parameters);

            return(await SqlMapper.ExecuteScalarAsync <T>(cnn, strSql, param, transaction, commandTimeout, commandType));
        }
Exemplo n.º 5
0
        public static T QuerySingleOrDefault <T>(this IDbConnection cnn, SQL sql, IDbTransaction transaction = null, int?commandTimeout = default(int?), CommandType?commandType = default(CommandType?))
        {
            var strSql = sql.Compile();
            var param  = new DapperParameter(sql.Parameters);

            return(SqlMapper.QuerySingleOrDefault <T>(cnn, strSql, param, transaction, commandTimeout, commandType));
        }