Chapter 11. Generics, Nullable Types, Partial Types, and Methods

When the .NET Framework was initially released, many C++ developers cited the lack of code templates as a primary reason for not moving to the .NET Framework. Generics, as introduced in version 2.0 of the .NET Framework, are more than simply design-time templates, because they have first-class support within the CLR. This chapter explores the syntax, in both C# and VB.NET, for consuming and creating generics. The chapter also looks at Nullable types, which help bridge the logical gap between database and object data; Partial types and methods, which help effectively partition code to promote code generation; and operator overloading.

Get Professional Visual Studio® 2008 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.