Check out this method:
1 | /// <summary> |
In particular this method signature.
1 | /// <summary> |
Notice 2 parameters
- [FromQuery] Guid companyID
- Long id
The [FromQuery] is a tag which tells the method to get the company ID as a parameter being passed in.
Here is an AI explanation
The companyID parameter is marked [FromQuery], so it appears as a query string parameter, not in the route path.
Looking at the Representative controller:
1 | []public async Task<IActionResult> GetOneAsync([FromQuery] Guid companyID, long id) |
- {id} is a route parameter (in the path), so it appears in the URL: /api/v1/Representative/GetOne/{id}
- companyID is [FromQuery], so it appears as a query parameter: ?companyID=…
Here is a curl example
1 | curl -X 'GET' \ |