public List<ResultSet> ExecuteAdHocQuery(string adhocQuery, CommandOptions commandOptions) { Open(); using (var command = new SqlCommand()) { command.CommandTimeout = commandOptions.CommandTimeout; command.CommandType = CommandType.Text; command.CommandText = adhocQuery; command.Connection = connection; command.Transaction = transaction; using (var reader = command.ExecuteReader()) { return ConvertReaderToMultipleResultSet(reader); } } }
public List<ResultSet> ExecuteStoredProcedure(string procedureName, Dictionary<string, object> parameters, CommandOptions commandOptions) { Open(); using (var command = new SqlCommand()) { command.CommandTimeout = commandOptions.CommandTimeout; command.CommandType = CommandType.StoredProcedure; command.CommandText = procedureName; command.Connection = connection; command.Transaction = transaction; foreach (var parameter in parameters) { command.Parameters.Add(new SqlParameter(parameter.Key, parameter.Value)); } using (var reader = command.ExecuteReader()) { return ConvertReaderToMultipleResultSet(reader); } } }
public List<ResultSet> ExecuteStoredProcedure(string procedureName, Dictionary<string, object> parameters, CommandOptions commandOptions) { if (procedureName.Contains('.')) { throw new ArgumentException("MySql does not support schemas"); } Open(); using (var command = new MySqlCommand()) { command.CommandTimeout = commandOptions.CommandTimeout; command.CommandType = CommandType.StoredProcedure; command.CommandText = procedureName; command.Connection = connection; command.Transaction = transaction; foreach (var parameter in parameters) { command.Parameters.Add(new MySqlParameter(parameter.Key, parameter.Value)); } using (var reader = command.ExecuteReader()) { return ConvertReaderToMultipleResultSet(reader); } } }
private MultipleResultSetConverter ExecuteStoredProcedure(string sprocName, Dictionary <string, object> parameters, CommandOptions commandOptions) { var schemaPrefix = GetSchemaPrefix(sprocName); return(WithCommand((command) => { return new MultipleResultSetConverter(command.ExecuteStoredProcedure(schemaPrefix + sprocName, parameters, commandOptions)); })); }
public MultipleResultSetConverter ExecuteAdHocQuery(string adhocQuery, CommandOptions commandOptions) { return(WithCommand((command) => { return new MultipleResultSetConverter(command.ExecuteAdHocQuery(adhocQuery, commandOptions)); })); }
public MultipleResultSetConverter ExecuteStoredProcedure <InputModel>(InputModel inputModel, CommandOptions commandOptions, [CallerMemberName] string sprocName = "") { return(ExecuteStoredProcedure(sprocName, GetParameters(inputModel), commandOptions)); }
public MultipleResultSetConverter ExecuteStoredProcedure(CommandOptions commandOptions, [CallerMemberName] string sprocName = "") { return(ExecuteStoredProcedure(sprocName, new Dictionary <string, object>(), commandOptions)); }