title: How to group by and order by, with LINQ, NHibernate and uNHAddins
body: <p>We're building a WPF application, using Oracle database, also using NHibernate and uNHAddins extensions. In a DataGrid, we're trying to get values from a table, with this query LINQ:</p>
  
  <pre><code>return (from f in rFConsumption.GetAll()
                  let d = f.CounterDtm
                  where f.CounterDtm &gt;= dataHoraInicio &amp;&amp; f.CounterDtm &lt;= dataHoraFim
                  group f by (d.Year - 2000) * 384 + d.Month * 32 + d.Day into g
                  select new RFConsumption
                  {                       
                      COGCounter1 = (g.Sum(f =&gt; f.COGCounter1)),
                      BFCounter1 = (g.Sum(f =&gt; f.BFCounter1)),
                      NatGasCounter1 = (g.Sum(f =&gt; f.NatGasCounter1)),
                      MixGasCounter1 = (g.Sum(f =&gt; f.MixGasCounter1)),
                      COGCounter2 = (g.Sum(f =&gt; f.COGCounter2)),
                      BFCounter2 = (g.Sum(f =&gt; f.BFCounter2)),
                      NatGasCounter2 = (g.Sum(f =&gt; f.NatGasCounter2)),
                      MixGasCounter2 = (g.Sum(f =&gt; f.MixGasCounter2)),
                      COGCounter3 = (g.Sum(f =&gt; f.COGCounter3)),
                      BFCounter3 = (g.Sum(f =&gt; f.BFCounter3)),
                      NatGasCounter3 = (g.Sum(f =&gt; f.NatGasCounter3)),
                      MixGasCounter3 = (g.Sum(f =&gt; f.MixGasCounter3)),
                  }
                  ).ToList&lt;RFConsumption&gt;();
  </code></pre>
  
  <p>So, my question is:
  <b> <li> How I do to use group by, with order by, using NHibernate;</li></b>
  <b>
  <li> How can i make group by return date data field to that specified group.</li></b></p>