This topic provides an overview of the generic collection classes and other generic types in the .NET Framework.
Generic Collections in the .NET Framework
The .NET Framework class library provides a number of generic collection classes in the System.Collections.Generic and System.Collections.ObjectModel namespaces. For more information about these classes, see Commonly Used Collection Types.
System.Collections.Generic
System.Collections.ObjectModel
The Nullable<(Of <(T>)>) generic structure allows you to use value types as if they could be assigned null. This can be useful when working with database queries, where fields that contain value types can be missing. The generic type parameter can be any value type.
Note: |
|---|
In C# it is not necessary to use Nullable<(Of <(T>)>) explicitly because the language has syntax for nullable types. |
The ArraySegment<(Of <(T>)>) generic structure provides a way to delimit a range of elements within a one-dimensional, zero-based array of any type. The generic type parameter is the type of the array's elements.
The EventHandler<(Of <(TEventArgs>)>) generic delegate eliminates the need to declare a delegate type to handle events, if your event follows the event-handling pattern used by the .NET Framework. For example, suppose you have created a MyEventArgs class, derived from EventArgs, to hold the data for your event. You can then declare the event as follows:
Public Event MyEvent As EventHandler(Of MyEventArgs)
public event EventHandler<MyEventArgs> MyEvent;
public:
event EventHandler<MyEventArgs^>^ MyEvent;
Concepts
Reference
Other Resources