DynamicWhere.ex
DynamicWhere.exv2.1.0·docs

SummaryResult

SummaryResult is the return shape of ToListSummary and ToListAsyncSummary. It mirrors FilterResult<T> except Data is a list of dynamic objects whose properties are the GroupBy.Fields plus every AggregateBy.Alias.

Properties

PropertyTypeDescription
PageNumberintCurrent page (0 when no pagination).
PageSizeintPage size (0 when no pagination).
PageCountintTotal pages.
TotalCountintTotal grouped records.
DataList<dynamic>Dynamic objects with group keys + aggregation values.
QueryStringstring?Generated SQL (when getQueryString: true is passed).
Flattened alias keys
Each row in Data is a dynamic object whose top-level properties are the GroupBy.Fields names plus the AggregateBy.Alias names. There is no nesting under "group" / "aggregates" — everything is flat.

C# usage

SummaryResult result = await dbContext.Orders.ToListAsync(summary);

foreach (dynamic row in result.Data)
{
    Console.WriteLine($"{row.Country}: {row.Total} orders, revenue {row.Revenue}");
}

JSON response example

Given a Summary grouping by Country with aliases Total (Count) and Revenue (Sum of Amount):

{
  "pageNumber": 1,
  "pageSize": 20,
  "pageCount": 1,
  "totalCount": 3,
  "data": [
    { "Country": "IQ", "Total": 142, "Revenue": 28450.75 },
    { "Country": "SA", "Total": 98,  "Revenue": 19120.00 },
    { "Country": "AE", "Total": 31,  "Revenue":  6940.50 }
  ],
  "queryString": null
}

See also