title: NHibernate: returning a strongly typed list having applied an aggregate function
body: <p>I'd like to have nHibernate return a strongly typed list from a CreateQuery invocation using HQL. </p>
  
  <p>We'd like a strongly typed list of "MyType" returned, but we'd like to apply an aggregate function to the resultset before it's returned. Unfortunately, as I understand it, adding the aggregate field means nHibernate is unable to match the results to the signature of our "MyType" type.</p>
  
  <p>How do we get around this? The following query describes what we'd like to return from the database - but the "feedcount" field affects nHibernate's ability to determine the typed list to return.</p>
  
  <pre><code>select feedname, count(feedurl) as feedcount from rsssubscriptions group by feedurl, feedname order by feedcount desc
  </code></pre>
  
  <p>Presumably the resultset has to be generated earlier in the sequence of events, to ensure nHibenate can infer the correct type to instantiate for each record.</p>
  
  <p>Thanks</p>