The [FromQuery] attribute tells ASP.NET Core model binding to obtain a parameter’s values from the request query string. It is especially useful when a complex request DTO replaces several simple action parameters, because complex types otherwise bind from the request body by default. section 6.1.5
Bind BoardGamesController filters from the query string
Define a RequestDTO containing pagination, sorting, and filtering properties, then declare the action parameter as [FromQuery] RequestDTO input. The action reads input.FilterQuery, input.SortColumn, input.SortOrder, input.PageIndex, and input.PageSize while preserving GET query-string behavior. section 6.1.5
Attribute-based binding can select other request sources:
- [FromRoute] uses route data; [FromForm] uses posted form fields; [FromBody] uses the request body; [FromHeader] uses HTTP headers; and [FromServices] uses a registered service. section 6.1.5
- Use [FromQuery] explicitly when a complex DTO must retain query-string binding rather than use the default request-body binding. section 6.1.5


