title: How to use Pivot table with Entity Framework?
body: <p>I have a table something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/oLQQw.pngit" alt="enter image description here"></p>
  
  <p>I would like to use EF which will use a stored procedure which will return a unpivot result set back. But the problem is, how would I model it so that I can use it in RIA services to push the data to client. I was going for something like this </p>
  
  <pre><code>public class RegionModel {
      public string Name { get; set; }
      public List&lt;string&gt; Quarter { get; set; }
      public List&lt;int&gt; Sales { get; set; }
  }
  </code></pre>
  
  <p>Same way there will be a <code>QuarterModel</code> as well. Based on the user selection, I can return the proper collection for binding. Currently we have solved this by creating dynamic class at the client side. But interested to know is it possible to achieve this without client side code and leverage the EF and SQL Server unpivot.</p>