title: Fluent NHibernate Map a Stored Procedure which returns a Dynamic set of Columns
body: <p>I have to access a set of stored procedures via NHibernate.</p>
  
  <p>One of these stored procedures returns a result, however the columns returned are different based on the parameters passed in.</p>
  
  <p>For example if I pass in the dates 01/01/2014 and 01/01/2015 I might get the results</p>
  
  <p>column1, column2, column3</p>
  
  <p>However if I pass in a different date range the stored procedure may return a different set of columns e.g.</p>
  
  <p>column1, column2, column3, column4, column5, column6</p>
  
  <p>How can I map this to an entity?</p>
  
  <p>Is it possible to somehow have a map that maps all the columns that could possibly come back and then just set the properties as null if the column does not come back from the stored procedure?</p>
  
  <pre><code>public class ModelMap : ClassMap&lt;Model&gt;
      {
          public ModelMap()
          {
              this.ReadOnly();
              this.Id(x =&gt; x.Date);
              this.Map(x =&gt; x.Column1)
              this.Map(x =&gt; x.Column2)
              this.Map(x =&gt; x.Column3)
              this.Map(x =&gt; x.Column4)
              this.Map(x =&gt; x.Column5)
              this.Map(x =&gt; x.Column6)            
          }
      }
  </code></pre>
  
  <p>Any ideas on how I could get this type of stored procedure to map to an entity?</p>