7 Comparing objects
This chapter covers
- Implementing the
GetCustomerByName
method - Viewing methods through the lens of lambda calculus
- Using nullable types
- Using custom exceptions
- Operator overloading and custom equality comparisons
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.
Get Code like a Pro in C# now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.