This chapter covers
- Discovering the underlying type of an object at compile time and run time
- Writing code that uses IDisposable and using statements to dispose of unmanaged resources
- Using method and constructor overloading
- Using attributes
- Accepting a JSON or XML input in an endpoint and parsing it into a custom object
In chapter 3, the CEO of Flying Dutchman Airlines, Aljen van der Meulen, assigned us a project to revamp Flying Dutchman Airlines’ backend service so that the company can integrate with a third-party system (a flight aggregator called FlyTomorow). We were given an OpenAPI specification and took a look at the database schema and the configuration, model, and view classes. Figure 4.1 shows where we are in the scheme of the book.
Figure 4.1 In this chapter, we’ll bring part 2 to a close. We’ll look at the existing codebase’s controller class and discuss potential improvements we can make to the code.
