private CreateOracleConnection ( ) : OracleConnection | ||
return | OracleConnection |
public static IEnumerable <T> ReaderFrom <T>(this OracleConnectionProvider provider, string sqlText, Action <OracleCommand> modCommand, Func <IDataReader, T> select) { using (var cn = provider.CreateOracleConnection()) { var command = cn.CreateCommand(); command.CommandType = CommandType.Text; command.CommandText = sqlText; modCommand(command); cn.Open(); using (var reader = command.ExecuteReader()) { while (reader.Read()) { yield return(select(reader)); } } } }
public IEnumerable <ResultSet> Execute(IDictionary <string, object> suppliedParameters, IDbTransaction transaction) { var procedure = _schema.FindProcedure(_procedureName); if (procedure == null) { throw new UnresolvableObjectException(_procedureName.ToString()); } var cn = (transaction == null) ? (IDbConnection)_connectionProvider.CreateOracleConnection() : transaction.Connection; var command = cn.CreateCommand() as OracleCommand; // Double-underscore is used to denote a package name command.CommandText = ResolvePackageCallAndQuote(procedure); command.CommandType = CommandType.StoredProcedure; SetParameters(procedure, command, suppliedParameters); try { var result = _executeImpl(command); suppliedParameters["__ReturnValue"] = command.GetReturnValue(); RetrieveOutputParameters(command.Parameters, suppliedParameters); return(result); } catch (DbException ex) { throw new AdoAdapterException(ex.Message, command); } finally { command.Dispose(); if (transaction == null) { cn.Dispose(); } } }