In the previous chapter, we learned about persisting aggregates to different types of databases. However, we haven't looked at the topic of retrieving data from a database, except using the repository Load method to retrieve a single aggregate.
It is now time to get a hold on the data we managed to store in the database and add some GET endpoints to the API. For this book, I had no plans to show you how to build repositories with numerous GetByThat methods or, even worse, a generic repository that returns IQueryable<T>. That kind of approach, while it might seem attractive, removes the Ubiquitous Language from queries, since developers start to retrieve aggregates by filtering properties. For example, a query such as _repository.Query(x => x.State == State.IsActive && x.Price.Amount > 100) tells us very little about the intention of...