views:

27

answers:

1

Is there a way to do this :

SubSonic.Where filter = new SubSonic.Where();
filter.ColumnName = Region.Columns.Region;
filter.Comparison = SubSonic.Comparison.IsNot;
filter.ParameterValue = null;

SubSonic.Aggregate orderBy = new SubSonic.Aggregate(Region.Columns.RegionName, SubSonic.AggregateFunction.GroupBy);

RegionCollection regions = new RegionCollection().Where(filter).GroupBy(groupBy).Load();

The "GroupBy" part in the last line doesn't compile... (I'm using SubSonic 2.1)

A: 

With Collections you can use OrderByAsc and OrderByDesc but they both only allow passing a string as a parameter. And the SubSonic.AggregateFunction.GroupByprobably isn't what you want.

Try this instead:

var result = new RegionCollection().OrderByAsc(Region.Columns.RegionName).Load();
SchlaWiener
sorry, I meant GroupBy :(
mrmuggles