title: EntLib 6 and ODP.NET - Accessor loses parameters
body: <p>I'm sure I can't be the first one trying to use EntLib 6's Accessors to execute an Oracle SP with parameters. It all worked fine and dandy when I was using the (deprecated) OracleClient from MS, but when I switched to Oracle's own ODP.NET (using EntLibContrib 6) I started getting the infamous <em>"wrong number or types of arguments in call to 'TEST_PROCEDURE'"</em>.</p>
  
  <p>Here's my code:</p>
  
  <p><strong>Main</strong></p>
  
  <pre><code>var query = "TEST_PROCEDURE";
  
  var accessor = _db.CreateSprocAccessor(
      query, 
      new OracleParamMapper(),
      new ColumnMapper&lt;MyEntity&gt;().Map()
  );
  
  var p1 = new OracleParameter("param1", OracleDbType.Varchar2, 1);
  p1.Direction = ParameterDirection.Input;
  p1.Value = "T";
  
  var p2 = new OracleParameter("param2", OracleDbType.RefCursor);
  p2.Direction = ParameterDirection.Output;
  
  return accessor.Execute(p1, p2);
  </code></pre>
  
  <p><strong>OracleParamMapper</strong></p>
  
  <pre><code>public class OracleParamMapper : IParameterMapper
  {
      public void AssignParameters(DbCommand command, object[] parameterValues)
      {
          ((OracleCommand)command).BindByName = true;
  
          foreach (var item in parameterValues)
          {
              command.Parameters.Add(item);
          }
      }
  }
  </code></pre>
  
  <p><strong>This mapper gets invoked,</strong> and I can see the parameters being correctly added to the collection, but then for some misterious reason they seem to disappear when the call to Execute is made.</p>
  
  <p><strong>Stored Procedure</strong></p>
  
  <pre><code>PROCEDURE TEST_PROCEDURE (param1  IN VARCHAR2, param2  IN OUT SYS_REFCURSOR);
  </code></pre>
  
  <p>Has anyone been able to make this work? Thanks in advance.</p>