0
I need to implement an API that receives parameters for daughter entities Example: api/Orders/5/Products or api/Orders/5/Products/10. I need to pick up only the products of order number 5 or still, pick up only order product 10 5. I have this API and I need to change it, to meet this demand.
[HttpGet("{id}")]
public async Task<ActionResult<ResponseResult>> Get(Guid id)
{
var response = await _userHandler.Handle(new GetOrdersCommand { Id = id });
return response;
}
Would you like to know how I can implement this in my API? What controller would the implementation be in if only the products of an order were to return? How will the route configuration of this API
https://docs.microsoft.com/pt-br/aspnet/core/mvc/controllers/routing?view=aspnetcore-2.1
– Roberto de Campos
@Reníciuspagotto, is your question the same as the other? https://answall.com/questions/318682/asp-net-core-searchem-requisi%C3%A7%C3%B5es-get
– Leandro Angelo
https://stackoverflow.com/questions/19891494/how-to-pass-receive-multiple-args-to-a-restful-web-api-get-method
– StatelessDev
@Leandroangelo These are questions for different purposes
– Renicius Pagotto