title: Generic wrapper for stored procedure execution
body: <p>How can I execute stored procedures generically?  I tried:</p>
  
  <p><code>_context.Set&lt;TEntity&gt;();</code></p>
  
  <p>I want to avoid embedded SQL such as:</p>
  
  <p><code>context.Database.SqlQuery&lt;TEntity&gt;(storedProcedureName);</code></p>
  
  <p>However, because the stored procedure is accessed via a Function rather than a Type this does not work.  I also tried creating/accessing via a function mapping.  The complex type for the return result exists, but this can't be used to obtain the result itself.</p>
  
  <p>Do I need Delegates or is there support for this somewhere?</p>
  
  <p>To be clear, I hope to create something like....</p>
  
  <pre><code>public IEnumerable&lt;TEntityResult&gt; ReadSpAll&lt;TEntity,TEntityResult&gt;(IEnumerable&lt;SqlParameter&gt; sqlParameters) 
  </code></pre>
  
  <p>where <code>TEntity</code> is the stored proc and <code>TEntityResult</code> is the complex return type</p>