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()
6464 if ( _jsonApiContext . QuerySet != null && _jsonApiContext . QuerySet . IncludedRelationships != null && _jsonApiContext . QuerySet . IncludedRelationships . Count > 0 )
6565 entities = IncludeRelationships ( entities , _jsonApiContext . QuerySet . IncludedRelationships ) ;
6666
67+ if ( _jsonApiContext . Options . IncludeTotalRecordCount )
68+ _jsonApiContext . TotalRecords = await entities . CountAsync ( ) ;
69+
6770 // pagination should be done last since it will execute the query
6871 var pagedEntities = await ApplyPageQueryAsync ( entities ) ;
6972
Original file line number Diff line number Diff line change @@ -15,5 +15,6 @@ public interface IJsonApiContext
1515 QuerySet QuerySet { get ; set ; }
1616 bool IsRelationshipData { get ; set ; }
1717 List < string > IncludedRelationships { get ; set ; }
18+ int TotalRecords { get ; set ; }
1819 }
1920}
You can’t perform that action at this time.
0 commit comments