I am implementing the repository pattern in my application.
The repository will connect to an API to download orders from an external API. The API that I am connecting to has a separate endpoint to get the list of Orders and a separate endpoint to get the Items against that order.
Where should the marriage of OrderItems
and Orders
happen? Should the GetOrders()
function in my repository get orders as well as items, returning it back to the service with both orders and items. Or should the service layer be responsible for running GetOrders()
and GetOrderItems()
and joining these together?
Hope that makes sense!