A Repository is an abstraction that makes your domain think it's dealing with an in-memory collection of objects, hiding the complexity of SQL, Mongo, or APIs.
In Clean Architecture, the **Interface** for the repository lives in the **Domain/Core** layer. The **Implementation** lives in the **Infrastructure** layer. This means your business rules never depend on DbContext or SQL strings. They only depend on IOrderRepository.
You should only have one repository per **Aggregate Root**. You don't need an OrderItemRepository if an Order is your Aggregate Root. You load the whole Order, modify its items, and save the Order. The repository handles the graph of objects as a single unit.
Q: "Is the Repository pattern dead because of EF Core?"
Architect Answer: "Technically, DbSet is a repository. But for **Clean Architecture**, the answer is NO, it's not dead. A custom repository allows you to hide 'leakage' of persistence logic (like .Include() or complex SQL optimizations) from your domain. It also makes Unit Testing your domain 10x easier because you can mock a simple interface instead of trying to mock the massive EF DbContext."