As others have said netcore will identify the most appropriate binding - it's helpful to understand how to control this in more detail - see here for the Microsoft documentation on it:
below is an example of a Get request where you can see explicit control of where to expect parameters to come from
app.MapGet("/{id}", ([FromRoute] int id,
                     [FromQuery(Name = "p")] int page,
                     [FromServices] Service service,
                     [FromHeader(Name = "Content-Type")] string contentType) 
                     => {});
It may also help to look around Model Binding in asp.net core as that also helps explain how it all works: https://learn.microsoft.com/en-us/aspnet/core/mvc/advanced/custom-model-binding?view=aspnetcore-9.0
HTH