This chapter introduces some programming tools that were new in .NET 2.0 and that are prerequisites for understanding and working effectively with the Windows Communication Foundation, including partial types, generics, nullable value types, the Lightweight Transaction Manager, and role providers.

To properly understand and work effectively with the Windows Communication Foundation, you should be familiar with certain facilities of the 2.0 versions of the .NET Framework and the .NET common language runtime. This chapter introduces them: partial types, generics, nullable value types, the Lightweight Transaction Manager, and role providers. The coverage of these features is not intended to be exhaustive, but merely sufficient to clarify their use in the chapters that follow.

Partial Types

Microsoft Visual C# 2005 allows the definition of a type to be composed from multiple partial definitions distributed across any number of source code files for the same module. That option is made available via the modifier partial, which can be added to the definition of a class, an interface, or a struct. Therefore, this part of the definition of a class

can together constitute the definition of the type MyClass. This example illustrates just one use for partial types, which is to organize the behavior of a class and its data into separate source code files.