ASP.NET Core - Search by daughter entities

Asked

Viewed 41 times

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

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.