In this chapter, we will look at the C# support for generic and anonymous types. Anonymous types are relatively simple, so most of this chapter is dedicated to the much more complex and involved topic of generic types.
Understanding generic types requires a good understanding of regular C# types, so if you have skipped over the chapters before this one, I suggest you go back and read more closely. Chapters 1, 3, and 9 have particular bearing on this chapter, which is summarized in Table 15-1.
Table 15-1. Quick Problem/Solution Reference for Chapter 15
Create a class, struct, or interface that works with a type that is selected at instantiation.
Create and instantiate a generic class, struct, ...