title: Dynamic SQL based stored procedure call in Entity Framework
body: <p>For one of our recent projects, we created a stored procedure which generated SQL and executed it in the end. The purpose of the stored procedure was to create pivots based on dynamic columns. </p>
  
  <p>When trying to access it using Entity Framework using the usual function import when I tried to access the stored procedure, it would return anything as it requires a dynamic type to store the retrieved data. </p>
  
  <p>Which in our case was a dynamic query and linq was unable to get the returned columns. So to work around what I did was call the stored procedure in the traditional way i.e. creating a <code>DataAdapter</code> and <code>SqlCommand</code> object and <code>SqlConnection</code> object. </p>
  
  <p>But what is the proper way of calling this kind of stored procedure using Entity Framework?</p>
  
  <p>Thanks in advance.</p>