File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,32 +141,4 @@ public async Task<IActionResult> GetPublisherStatsAsync()
141141}
142142```
143143
144- ### Manual Filter Application
145- ``` csharp
146- [HttpGet (" monthly-stats" )]
147- public async Task < IActionResult > GetMonthlyStatsAsync ()
148- {
149- var queryParams = GetJsonApiQueryParameters ();
150-
151- // Apply filters to source entity
152- var query = _context .Books .AsQueryable ();
153- if (queryParams .Filter != null )
154- {
155- query = query .ApplyFilters (queryParams .Filter , Logger );
156- }
157-
158- // Aggregate by month
159- var stats = query
160- .GroupBy (b => new { b .PublishedDate .Year , b .PublishedDate .Month })
161- .Select (g => new MonthlyStatsDto
162- {
163- Year = g .Key .Year ,
164- Month = g .Key .Month ,
165- BookCount = g .Count ()
166- });
167-
168- return Ok (await stats .ToListAsync ());
169- }
170- ```
171-
172144
You can’t perform that action at this time.
0 commit comments