Beispiel #1
0
 public T QueryForObject <T>(string connString,
                             string commandText,
                             IDbParameters parameterValues,
                             IDataTableRowMapper <T> rowMapper)
 {
     return(QueryForObject(connString, CommandType.Text, commandText, TIMEOUT_DEFAULT, parameterValues, 0, rowMapper));
 }
Beispiel #2
0
 public IList <T> QueryWithRowMapper <T>(string connString,
                                         CommandType commandType,
                                         string commandText,
                                         int timeoutInSeconds,
                                         IDbParameters parameterValues,
                                         int tableIndex,
                                         IDataTableRowMapper <T> rowMapper)
 {
     return(QueryWithResultSetExtractor(connString,
                                        commandType,
                                        commandText,
                                        timeoutInSeconds,
                                        parameterValues,
                                        tableIndex,
                                        new RowMapperResultSetExtractor <T>(rowMapper)));
 }
Beispiel #3
0
        public T QueryForObject <T>(string connString,
                                    CommandType commandType,
                                    string commandText,
                                    int timeoutInSeconds,
                                    IDbParameters parameterValues,
                                    int tableIndex,
                                    IDataTableRowMapper <T> rowMapper)
        {
            IList <T> results = QueryWithRowMapper(connString, commandType, commandText, timeoutInSeconds, parameterValues,
                                                   tableIndex, rowMapper);

            if (results == null || results.Count == 0)
            {
                return(default(T));
            }
            return(results[0]);
        }
Beispiel #4
0
 public T QueryForObject <T>(string connString,
                             string commandText,
                             IDataTableRowMapper <T> rowMapper)
 {
     return(QueryForObject(connString, CommandType.Text, commandText, TIMEOUT_DEFAULT, null, 0, rowMapper));
 }
Beispiel #5
0
 public IList <T> QueryWithRowMapper <T>(string connString,
                                         string commandText,
                                         IDataTableRowMapper <T> rowMapper)
 {
     return(QueryWithRowMapper(connString, CommandType.Text, commandText, TIMEOUT_DEFAULT, null, 0, rowMapper));
 }
Beispiel #6
0
        public RowMapperResultSetExtractor(IDataTableRowMapper <T> rowMapper)
        {
            AssertUtils.ArgumentNotNull(rowMapper, "rowMapper");

            this.rowMapper = rowMapper;
        }