Filtering list endpoints is one of the most common tasks in a web API: "get timesheets by date range," "orders by status," "projects by customer," etc. The trouble isn't returning the data - it's keeping the query parameters typed, consistent, and easy to evolve without sprinkling manual parsing all over your controllers.
This post introduces DevInstance.WebServiceToolkit.Http.Query (a part of WebServiceToolkit library), a tiny toolkit that lets you:
- Define a typed query model with
[QueryModel] and optional [QueryName] and [DefaultValue].
- Automatically bind a URL query string (e.g.
?from=2025-10-01&to=2025-10-31&status=Open&page=2&pageSize=50) into that model.
- Support primitives, enums,
DateOnly, TimeOnly, Guid, and comma-separated arrays out of the box.
- Register it with a one-liner in Program.cs.
Read more...