9 Extension methods, streams, and abstract classes

This chapter covers

  • Using streams to redirect console output
  • Using abstract classes to provide common functionality across derived classes
  • Using the AddRange LINQ method to add many things to a collection at once
  • Using the SortedList collection
  • Using extension methods to extend existing types with new functionality
  • Refactoring “magic numbers”

In sections 3.1 and 3.2, the CEO of Flying Dutchman Airlines tasked us with creating a new version of the existing FlyingDutchmanAirlines codebase. The existing codebase is old and riddled with design flaws, and does not play nice with the new API requirements put in place by a newly signed business deal with a search aggregator. In chapters 3 and 4, ...

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.