Colecciones

System.Collections.Generic Namespace

Contains interfaces and classes that define generic collections, which allow users to create strongly typed collections that provide better type safety and performance than non-generic strongly typed collections.

Classes

CollectionExtensionsProvides extension methods for generic collections.
ComparerProvides a base class for implementations of the IComparer generic interface.
Dictionary<TKey,TValue>.KeyCollectionRepresents the collection of keys in a Dictionary<TKey,TValue>. This class cannot be inherited.
Dictionary<TKey,TValue>.ValueCollectionRepresents the collection of values in a Dictionary<TKey,TValue>. This class cannot be inherited.
Dictionary<TKey,TValue>Represents a collection of keys and values.
EqualityComparerProvides a base class for implementations of the IEqualityComparer generic interface.
HashSetRepresents a set of values.
KeyNotFoundExceptionThe exception that is thrown when the key specified for accessing an element in a collection does not match any key in the collection.
KeyValuePairCreates instances of the KeyValuePair<TKey,TValue> struct.
LinkedListRepresents a doubly linked list.
LinkedListNodeRepresents a node in a LinkedList. This class cannot be inherited.
ListRepresents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists.
PriorityQueue<TElement,TPriority>.UnorderedItemsCollectionEnumerates the contents of a PriorityQueue<TElement,TPriority>, without any ordering guarantees.
PriorityQueue<TElement,TPriority>Represents a collection of items that have a value and a priority. On dequeue, the item with the lowest priority value is removed.
QueueRepresents a first-in, first-out collection of objects.
ReferenceEqualityComparerAn IEqualityComparer that uses reference equality (ReferenceEquals(Object, Object)) instead of value equality (Equals(Object)) when comparing two object instances.
SortedDictionary<TKey,TValue>.KeyCollectionRepresents the collection of keys in a SortedDictionary<TKey,TValue>. This class cannot be inherited.
SortedDictionary<TKey,TValue>.ValueCollectionRepresents the collection of values in a SortedDictionary<TKey,TValue>. This class cannot be inherited.
SortedDictionary<TKey,TValue>Represents a collection of key/value pairs that are sorted on the key.
SortedList<TKey,TValue>Represents a collection of key/value pairs that are sorted by key based on the associated IComparer implementation.
SortedSetRepresents a collection of objects that is maintained in sorted order.
StackRepresents a variable size last-in-first-out (LIFO) collection of instances of the same specified type.

Structs

Dictionary<TKey,TValue>.EnumeratorEnumerates the elements of a Dictionary<TKey,TValue>.
Dictionary<TKey,TValue>.KeyCollection.EnumeratorEnumerates the elements of a Dictionary<TKey,TValue>.KeyCollection.
Dictionary<TKey,TValue>.ValueCollection.EnumeratorEnumerates the elements of a Dictionary<TKey,TValue>.ValueCollection.
HashSet.EnumeratorEnumerates the elements of a HashSet object.
KeyValuePair<TKey,TValue>Defines a key/value pair that can be set or retrieved.
LinkedList.EnumeratorEnumerates the elements of a LinkedList.
List.EnumeratorEnumerates the elements of a List.
PriorityQueue<TElement,TPriority>.UnorderedItemsCollection.EnumeratorEnumerates the element and priority pairs of a PriorityQueue<TElement,TPriority>, without any ordering guarantees.
Queue.EnumeratorEnumerates the elements of a Queue.
SortedDictionary<TKey,TValue>.EnumeratorEnumerates the elements of a SortedDictionary<TKey,TValue>.
SortedDictionary<TKey,TValue>.KeyCollection.EnumeratorEnumerates the elements of a SortedDictionary<TKey,TValue>.KeyCollection.
SortedDictionary<TKey,TValue>.ValueCollection.EnumeratorEnumerates the elements of a SortedDictionary<TKey,TValue>.ValueCollection.
SortedSet.EnumeratorEnumerates the elements of a SortedSet object.
Stack.EnumeratorEnumerates the elements of a Stack.

Interfaces

IAsyncEnumerableExposes an enumerator that provides asynchronous iteration over values of a specified type.
IAsyncEnumeratorSupports a simple asynchronous iteration over a generic collection.
ICollectionDefines methods to manipulate generic collections.
IComparerDefines a method that a type implements to compare two objects.
IDictionary<TKey,TValue>Represents a generic collection of key/value pairs.
IEnumerableExposes the enumerator, which supports a simple iteration over a collection of a specified type.
IEnumeratorSupports a simple iteration over a generic collection.
IEqualityComparerDefines methods to support the comparison of objects for equality.
IListRepresents a collection of objects that can be individually accessed by index.
IReadOnlyCollectionRepresents a strongly-typed, read-only collection of elements.
IReadOnlyDictionary<TKey,TValue>Represents a generic read-only collection of key/value pairs.
IReadOnlyListRepresents a read-only collection of elements that can be accessed by index.
IReadOnlySetProvides a readonly abstraction of a set.
ISetProvides the base interface for the abstraction of sets.

See also