Andy,
My thought on this is...
Let's say you have a ProductType class which is your DAL2 model. You create another class that is just a simple POCO.
Example:
public class ProductTypeSummary
{
public int ProductType { get; set; }
public int ProductTypeCount { get; set; }
}
Inside your ProductType DAL Repository class, you can add a method like:
public IEnumerable<ProductTypeSummary> GetProductTypeSummary()
{
using (IDataContext ctx = DataContext.Instance())
{
return ctx.ExecuteQuery<ProductTypeSummary>(System.Data.CommandType.Text,
"SELECT ProductType, COUNT(*) AS ProductTypeCount FROM Products GROUP BY ProductType");
}
}
I haven't tested this obviously, but I think it should work.