File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ public virtual async Task<IActionResult> GetAsync()
64
64
if ( _jsonApiContext . QuerySet != null && _jsonApiContext . QuerySet . IncludedRelationships != null && _jsonApiContext . QuerySet . IncludedRelationships . Count > 0 )
65
65
entities = IncludeRelationships ( entities , _jsonApiContext . QuerySet . IncludedRelationships ) ;
66
66
67
+ if ( _jsonApiContext . Options . IncludeTotalRecordCount )
68
+ _jsonApiContext . TotalRecords = await entities . CountAsync ( ) ;
69
+
67
70
// pagination should be done last since it will execute the query
68
71
var pagedEntities = await ApplyPageQueryAsync ( entities ) ;
69
72
Original file line number Diff line number Diff line change @@ -15,5 +15,6 @@ public interface IJsonApiContext
15
15
QuerySet QuerySet { get ; set ; }
16
16
bool IsRelationshipData { get ; set ; }
17
17
List < string > IncludedRelationships { get ; set ; }
18
+ int TotalRecords { get ; set ; }
18
19
}
19
20
}
You can’t perform that action at this time.
0 commit comments