DynamicWhere.ex
DynamicWhere.exv2.1.0·docs

FilterResult<T>

FilterResult<T> is the strongly-typed wrapper returned by every terminal filter extension — ToListFilter, ToListAsyncFilter, and the dynamic variants. It contains the result page plus pagination metadata.

Properties

PropertyTypeDescription
PageNumberintCurrent page (0 when no pagination).
PageSizeintPage size (0 when no pagination).
PageCountintTotal pages.
TotalCountintTotal matching records.
DataList<T>The result entities.
QueryStringstring?Generated SQL (when getQueryString: true is passed to the extension).
Note
When the input Filter has no Page, PageNumber and PageSize come back as 0, and PageCount is 1 with the full result in Data.

C# usage

FilterResult<Customer> result = await dbContext.Customers.ToListAsync(filter);

Console.WriteLine($"page {result.PageNumber} of {result.PageCount}");
Console.WriteLine($"{result.TotalCount} total matches");

foreach (var customer in result.Data)
{
    Console.WriteLine($"- {customer.Name}");
}

JSON response example

{
  "pageNumber": 1,
  "pageSize": 10,
  "pageCount": 5,
  "totalCount": 42,
  "data": [
    { "id": 7, "name": "John Doe", "createdAt": "2025-09-14T12:31:00Z" },
    { "id": 8, "name": "Jane Roe", "createdAt": "2025-09-13T08:11:00Z" }
  ],
  "queryString": null
}

See also