GroupBy in DynamicQuery

Posts   
 
    
simmotech
User
Posts: 1024
Joined: 01-Feb-2006
# Posted on: 08-Jul-2013 09:15:08   

Would it be possible to add a GroupByAuto() method which automatically adds any relevant GroupBy clauses based on the Select(Expression<Func>> contents?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39912
Joined: 17-Aug-2003
# Posted on: 08-Jul-2013 10:47:37   

It would, but we won't add it, just as we don't add the missing fields in a groupby using query in the low-level api: grouping on fields just to make the query work isn't how one should write queries: not only is the order important, but it's also possible things like distinct won't work anymore. So if you need this, formulate the query yourself, or write a different query which only has the fields in the projection which make sense.

Frans Bouma | Lead developer LLBLGen Pro