Skip to content

Commit 549743c

Browse files
docs: 📝 update stats docs
1 parent b9c6546 commit 549743c

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

docs/docs/statistics-and-aggregations.md

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)