// Jeff Lanning ([email protected]): Added overload for OPath support public DataSet GetDataSet(Type entityType, CommandInfo commandInfo, CompiledQuery query, object[] parameterValues) { using (IDbConnection conn = ProviderFactory.GetConnection(this.connection, this.provider)) { IDbCommand cmd = CreateDbCommand(Guid.NewGuid(), entityType, commandInfo, conn, query, parameterValues); IDbDataAdapter adapter = ProviderFactory.GetAdapter(cmd, this.provider); DataSet dataSet = new DataSet("WilsonORMapper"); adapter.Fill(dataSet); return(dataSet); } }
// Includes support for typed datasets from Ben Priebe (http://stickfly.com) public DataSet TransactionDataSet(Guid transactionId, Type entityType, CommandInfo commandInfo, IDbTransaction transaction, DataSet dataSet, string sqlStatement, params Parameter[] parameters) { IDbCommand command = CreateDbCommand(transactionId, entityType, commandInfo, transaction.Connection, sqlStatement, parameters); command.Transaction = transaction; IDbDataAdapter adapter = ProviderFactory.GetAdapter(command, this.provider); if (dataSet == null) { dataSet = new DataSet("WilsonORMapper"); } if (dataSet.Tables.Count > 0) { string tableName = dataSet.Tables[0].TableName; (adapter as System.Data.Common.DbDataAdapter).Fill(dataSet, tableName); } else { adapter.Fill(dataSet); } this.SetOutputParameters(command, parameters); return(dataSet); }
// Includes support for typed datasets from Ben Priebe (http://stickfly.com) public DataSet GetDataSet(Type entityType, CommandInfo commandInfo, DataSet dataSet, string sqlStatement, params Parameter[] parameters) { if (dataSet == null) { dataSet = new DataSet("WilsonORMapper"); } using (IDbConnection connection = ProviderFactory.GetConnection(this.connection, this.provider)) { IDbCommand command = CreateDbCommand(Guid.NewGuid(), entityType, commandInfo, connection, sqlStatement, parameters); IDbDataAdapter adapter = ProviderFactory.GetAdapter(command, this.provider); if (dataSet.Tables.Count > 0) { string tableName = dataSet.Tables[0].TableName; (adapter as System.Data.Common.DbDataAdapter).Fill(dataSet, tableName); } else { adapter.Fill(dataSet); } this.SetOutputParameters(command, parameters); } return(dataSet); }