SegmentResult<T>
SegmentResult<T> is the return shape of ToListAsyncSegment. It inherits every property from FilterResult<T> — there are no additional members. The separate type exists only to distinguish results that came from a segment query (UNION / INTERSECT / EXCEPT) from those that came from a plain filter.
Inherited properties
| Property | Type | Description |
|---|---|---|
PageNumber | int | Current page (0 when no pagination). |
PageSize | int | Page size (0 when no pagination). |
PageCount | int | Total pages. |
TotalCount | int | Total matching records (across all combined sets). |
Data | List<T> | The result entities — already de-duplicated by the set operations. |
QueryString | string? | Generated SQL (when getQueryString: true is passed). |
Note
Because
SegmentResult<T> inherits FilterResult<T>, any helper or extension you write against the base type works for both.C# usage
SegmentResult<Customer> result = await dbContext.Customers.ToListAsyncSegment(segment);
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": 50,
"pageCount": 3,
"totalCount": 124,
"data": [
{ "id": 7, "name": "John Doe" },
{ "id": 12, "name": "Aisha Khan" }
],
"queryString": null
}See also
- Segment →
- FilterResult<T> → the base type.
- ToListAsyncSegment →