In the previous chapter, we implemented the CustomerRepository where we can add a customer to the database. We also learned how to use dependency injection to write testable code. This is a splendid start, but we are not done yet. We can add a Customer instance to the database, but how about retrieving one? See figure 7.1 for where we are in the scheme of the book.
Figure 7.1 In this chapter, we’ll continue the implementation of the CustomerRepository we started in chapter 6. This is the first step in implementing all the repositories for the Flying Dutchman Airlines service.

In this chapter, we’ll create the GetCustomerByName method that returns an appropriate Customer object when given a string containing the customer’s name. Implementing this method allows us to touch on some technical concepts we may have missed otherwise. As before, we’ll use test-driven development “light” to ensure our code quality is adequate. Even though the API doesn’t require an endpoint to get customers from the database, this method will prove useful for us when we implement our booking endpoint.