ConcurrentDictionary(Of TKey, TValue) Class
Represents a thread-safe collection of key-value pairs that can be accessed by multiple threads concurrently.
Assembly: mscorlib (in mscorlib.dll)
[SerializableAttribute] [ComVisibleAttribute(false)] [HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true, ExternalThreading = true)] public class ConcurrentDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable
Type Parameters
- TKey
The type of the keys in the dictionary.
- TValue
The type of the values in the dictionary.
The ConcurrentDictionary(Of TKey, TValue) type exposes the following members.
| Name | Description | |
|---|---|---|
|
ConcurrentDictionary(Of TKey, TValue) | Initializes a new instance of the ConcurrentDictionary(Of TKey, TValue) class that is empty, has the default concurrency level, has the default initial capacity, and uses the default comparer for the key type. |
|
ConcurrentDictionary(Of TKey, TValue)(IEnumerable(Of KeyValuePair(Of TKey, TValue))) | Initializes a new instance of the ConcurrentDictionary(Of TKey, TValue) class that contains elements copied from the specified IEnumerable(Of KeyValuePair(Of TKey, TValue)), has the default concurrency level, has the default initial capacity, and uses the default comparer for the key type. |
|
ConcurrentDictionary(Of TKey, TValue)(IEqualityComparer(Of TKey)) | Initializes a new instance of the ConcurrentDictionary(Of TKey, TValue) class that is empty, has the default concurrency level and capacity, and uses the specified IEqualityComparer(Of TKey). |
|
ConcurrentDictionary(Of TKey, TValue)(IEnumerable(Of KeyValuePair(Of TKey, TValue)), IEqualityComparer(Of TKey)) | Initializes a new instance of the ConcurrentDictionary(Of TKey, TValue) class that contains elements copied from the specified IEnumerable, has the default concurrency level, has the default initial capacity, and uses the specified IEqualityComparer(Of TKey). |
|
ConcurrentDictionary(Of TKey, TValue)(Int32, Int32) | Initializes a new instance of the ConcurrentDictionary(Of TKey, TValue) class that is empty, has the specified concurrency level and capacity, and uses the default comparer for the key type. |
|
ConcurrentDictionary(Of TKey, TValue)(Int32, IEnumerable(Of KeyValuePair(Of TKey, TValue)), IEqualityComparer(Of TKey)) | Initializes a new instance of the ConcurrentDictionary(Of TKey, TValue) class that contains elements copied from the specified IEnumerable, and uses the specified IEqualityComparer(Of TKey). |
|
ConcurrentDictionary(Of TKey, TValue)(Int32, Int32, IEqualityComparer(Of TKey)) | Initializes a new instance of the ConcurrentDictionary(Of TKey, TValue) class that is empty, has the specified concurrency level, has the specified initial capacity, and uses the specified IEqualityComparer(Of TKey). |
| Name | Description | |
|---|---|---|
|
Count | Gets the number of key/value pairs contained in the ConcurrentDictionary(Of TKey, TValue). |
|
IsEmpty | Gets a value that indicates whether the ConcurrentDictionary(Of TKey, TValue) is empty. |
|
Item | Gets or sets the value associated with the specified key. |
|
Keys | Gets a collection containing the keys in the Dictionary(Of TKey, TValue). |
|
Values | Gets a collection containing the values in the Dictionary(Of TKey, TValue). |
| Name | Description | |
|---|---|---|
|
AddOrUpdate(TKey, Func(Of TKey, TValue), Func(Of TKey, TValue, TValue)) | Adds a key/value pair to the ConcurrentDictionary(Of TKey, TValue) if the key does not already exist, or updates a key/value pair in the ConcurrentDictionary(Of TKey, TValue) if the key already exists. |
|
AddOrUpdate(TKey, TValue, Func(Of TKey, TValue, TValue)) | Adds a key/value pair to the ConcurrentDictionary(Of TKey, TValue) if the key does not already exist, or updates a key/value pair in the ConcurrentDictionary(Of TKey, TValue) if the key already exists. |
|
Clear | Removes all keys and values from the ConcurrentDictionary(Of TKey, TValue). |
|
ContainsKey | Determines whether the ConcurrentDictionary(Of TKey, TValue) contains the specified key. |
|
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
|
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
|
GetEnumerator | Returns an enumerator that iterates through the ConcurrentDictionary(Of TKey, TValue). |
|
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
|
GetOrAdd(TKey, Func(Of TKey, TValue)) | Adds a key/value pair to the ConcurrentDictionary(Of TKey, TValue) if the key does not already exist. |
|
GetOrAdd(TKey, TValue) | Adds a key/value pair to the ConcurrentDictionary(Of TKey, TValue) if the key does not already exist. |
|
GetType | Gets the Type of the current instance. (Inherited from Object.) |
|
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
|
ToArray | Copies the key and value pairs stored in the ConcurrentDictionary(Of TKey, TValue) to a new array. |
|
ToString | Returns a string that represents the current object. (Inherited from Object.) |
|
TryAdd | Attempts to add the specified key and value to the ConcurrentDictionary(Of TKey, TValue). |
|
TryGetValue | Attempts to get the value associated with the specified key from the ConcurrentDictionary(Of TKey, TValue). |
|
TryRemove | Attempts to remove and return the value with the specified key from the ConcurrentDictionary(Of TKey, TValue). |
|
TryUpdate | Compares the existing value for the specified key with a specified value, and if they are equal, updates the key with a third value. |
| Name | Description | |
|---|---|---|
|
Aggregate(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), KeyValuePair(Of TKey, TValue), KeyValuePair(Of TKey, TValue))) | Overloaded. Applies an accumulator function over a sequence. (Defined by Enumerable.) |
|
Aggregate(Of KeyValuePair(Of TKey, TValue), TAccumulate)(TAccumulate, Func(Of TAccumulate, KeyValuePair(Of TKey, TValue), TAccumulate)) | Overloaded. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. (Defined by Enumerable.) |
|
Aggregate(Of KeyValuePair(Of TKey, TValue), TAccumulate, TResult)(TAccumulate, Func(Of TAccumulate, KeyValuePair(Of TKey, TValue), TAccumulate), Func(Of TAccumulate, TResult)) | Overloaded. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. (Defined by Enumerable.) |
|
All(Of KeyValuePair(Of TKey, TValue)) | Determines whether all elements of a sequence satisfy a condition. (Defined by Enumerable.) |
|
Any(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Determines whether a sequence contains any elements. (Defined by Enumerable.) |
|
Any(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Determines whether any element of a sequence satisfies a condition. (Defined by Enumerable.) |
|
AsEnumerable(Of KeyValuePair(Of TKey, TValue)) | Returns the input typed as IEnumerable(Of T). (Defined by Enumerable.) |
|
AsParallel | Overloaded. Enables parallelization of a query. (Defined by ParallelEnumerable.) |
|
AsParallel(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Enables parallelization of a query. (Defined by ParallelEnumerable.) |
|
AsQueryable | Overloaded. Converts an IEnumerable to an IQueryable. (Defined by Queryable.) |
|
AsQueryable(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Converts a generic IEnumerable(Of T) to a generic IQueryable(Of T). (Defined by Queryable.) |
|
Average(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Decimal))) | Overloaded. Computes the average of a sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Average(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Double))) | Overloaded. Computes the average of a sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Average(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int32)) | Overloaded. Computes the average of a sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Average(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Int32))) | Overloaded. Computes the average of a sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Average(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int64)) | Overloaded. Computes the average of a sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Average(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Int64))) | Overloaded. Computes the average of a sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Average(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Single)) | Overloaded. Computes the average of a sequence of Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Average(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Single))) | Overloaded. Computes the average of a sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Average(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Double)) | Overloaded. Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Average(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Decimal)) | Overloaded. Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Cast(Of TResult) | Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
|
Concat(Of KeyValuePair(Of TKey, TValue)) | Concatenates two sequences. (Defined by Enumerable.) |
|
Contains(Of KeyValuePair(Of TKey, TValue))(KeyValuePair(Of TKey, TValue)) | Overloaded. Determines whether a sequence contains a specified element by using the default equality comparer. (Defined by Enumerable.) |
|
Contains(Of KeyValuePair(Of TKey, TValue))(KeyValuePair(Of TKey, TValue), IEqualityComparer(Of KeyValuePair(Of TKey, TValue))) | Overloaded. Determines whether a sequence contains a specified element by using a specified IEqualityComparer(Of T). (Defined by Enumerable.) |
|
Count(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the number of elements in a sequence. (Defined by Enumerable.) |
|
Count(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Returns a number that represents how many elements in the specified sequence satisfy a condition. (Defined by Enumerable.) |
|
DefaultIfEmpty(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty. (Defined by Enumerable.) |
|
DefaultIfEmpty(Of KeyValuePair(Of TKey, TValue))(KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty. (Defined by Enumerable.) |
|
Distinct(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns distinct elements from a sequence by using the default equality comparer to compare values. (Defined by Enumerable.) |
|
Distinct(Of KeyValuePair(Of TKey, TValue))(IEqualityComparer(Of KeyValuePair(Of TKey, TValue))) | Overloaded. Returns distinct elements from a sequence by using a specified IEqualityComparer(Of T) to compare values. (Defined by Enumerable.) |
|
ElementAt(Of KeyValuePair(Of TKey, TValue)) | Returns the element at a specified index in a sequence. (Defined by Enumerable.) |
|
ElementAtOrDefault(Of KeyValuePair(Of TKey, TValue)) | Returns the element at a specified index in a sequence or a default value if the index is out of range. (Defined by Enumerable.) |
|
Except(Of KeyValuePair(Of TKey, TValue))(IEnumerable(Of KeyValuePair(Of TKey, TValue))) | Overloaded. Produces the set difference of two sequences by using the default equality comparer to compare values. (Defined by Enumerable.) |
|
Except(Of KeyValuePair(Of TKey, TValue))(IEnumerable(Of KeyValuePair(Of TKey, TValue)), IEqualityComparer(Of KeyValuePair(Of TKey, TValue))) | Overloaded. Produces the set difference of two sequences by using the specified IEqualityComparer(Of T) to compare values. (Defined by Enumerable.) |
|
First(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the first element of a sequence. (Defined by Enumerable.) |
|
First(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Returns the first element in a sequence that satisfies a specified condition. (Defined by Enumerable.) |
|
FirstOrDefault(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the first element of a sequence, or a default value if the sequence contains no elements. (Defined by Enumerable.) |
|
FirstOrDefault(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. (Defined by Enumerable.) |
|
GroupBy(Of KeyValuePair(Of TKey, TValue), TKey)(Func(Of KeyValuePair(Of TKey, TValue), TKey)) | Overloaded. Groups the elements of a sequence according to a specified key selector function. (Defined by Enumerable.) |
|
GroupBy(Of KeyValuePair(Of TKey, TValue), TKey)(Func(Of KeyValuePair(Of TKey, TValue), TKey), IEqualityComparer(Of TKey)) | Overloaded. Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer. (Defined by Enumerable.) |
|
GroupBy(Of KeyValuePair(Of TKey, TValue), TKey, TElement)(Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of KeyValuePair(Of TKey, TValue), TElement)) | Overloaded. Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function. (Defined by Enumerable.) |
|
GroupBy(Of KeyValuePair(Of TKey, TValue), TKey, TResult)(Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of TKey, IEnumerable(Of KeyValuePair(Of TKey, TValue)), TResult)) | Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. (Defined by Enumerable.) |
|
GroupBy(Of KeyValuePair(Of TKey, TValue), TKey, TElement)(Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of KeyValuePair(Of TKey, TValue), TElement), IEqualityComparer(Of TKey)) | Overloaded. Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function. (Defined by Enumerable.) |
|
GroupBy(Of KeyValuePair(Of TKey, TValue), TKey, TResult)(Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of TKey, IEnumerable(Of KeyValuePair(Of TKey, TValue)), TResult), IEqualityComparer(Of TKey)) | Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer. (Defined by Enumerable.) |
|
GroupBy(Of KeyValuePair(Of TKey, TValue), TKey, TElement, TResult)(Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of KeyValuePair(Of TKey, TValue), TElement), Func(Of TKey, IEnumerable(Of TElement), TResult)) | Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function. (Defined by Enumerable.) |
|
GroupBy(Of KeyValuePair(Of TKey, TValue), TKey, TElement, TResult)(Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of KeyValuePair(Of TKey, TValue), TElement), Func(Of TKey, IEnumerable(Of TElement), TResult), IEqualityComparer(Of TKey)) | Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function. (Defined by Enumerable.) |
|
GroupJoin(Of KeyValuePair(Of TKey, TValue), TInner, TKey, TResult)(IEnumerable(Of TInner), Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of TInner, TKey), Func(Of KeyValuePair(Of TKey, TValue), IEnumerable(Of TInner), TResult)) | Overloaded. Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. (Defined by Enumerable.) |
|
GroupJoin(Of KeyValuePair(Of TKey, TValue), TInner, TKey, TResult)(IEnumerable(Of TInner), Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of TInner, TKey), Func(Of KeyValuePair(Of TKey, TValue), IEnumerable(Of TInner), TResult), IEqualityComparer(Of TKey)) | Overloaded. Correlates the elements of two sequences based on key equality and groups the results. A specified IEqualityComparer(Of T) is used to compare keys. (Defined by Enumerable.) |
|
Intersect(Of KeyValuePair(Of TKey, TValue))(IEnumerable(Of KeyValuePair(Of TKey, TValue))) | Overloaded. Produces the set intersection of two sequences by using the default equality comparer to compare values. (Defined by Enumerable.) |
|
Intersect(Of KeyValuePair(Of TKey, TValue))(IEnumerable(Of KeyValuePair(Of TKey, TValue)), IEqualityComparer(Of KeyValuePair(Of TKey, TValue))) | Overloaded. Produces the set intersection of two sequences by using the specified IEqualityComparer(Of T) to compare values. (Defined by Enumerable.) |
|
Join(Of KeyValuePair(Of TKey, TValue), TInner, TKey, TResult)(IEnumerable(Of TInner), Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of TInner, TKey), Func(Of KeyValuePair(Of TKey, TValue), TInner, TResult)) | Overloaded. Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. (Defined by Enumerable.) |
|
Join(Of KeyValuePair(Of TKey, TValue), TInner, TKey, TResult)(IEnumerable(Of TInner), Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of TInner, TKey), Func(Of KeyValuePair(Of TKey, TValue), TInner, TResult), IEqualityComparer(Of TKey)) | Overloaded. Correlates the elements of two sequences based on matching keys. A specified IEqualityComparer(Of T) is used to compare keys. (Defined by Enumerable.) |
|
Last(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the last element of a sequence. (Defined by Enumerable.) |
|
Last(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Returns the last element of a sequence that satisfies a specified condition. (Defined by Enumerable.) |
|
LastOrDefault(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the last element of a sequence, or a default value if the sequence contains no elements. (Defined by Enumerable.) |
|
LastOrDefault(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Returns the last element of a sequence that satisfies a condition or a default value if no such element is found. (Defined by Enumerable.) |
|
LongCount(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns an Int64 that represents the total number of elements in a sequence. (Defined by Enumerable.) |
|
LongCount(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Returns an Int64 that represents how many elements in a sequence satisfy a condition. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the maximum value in a generic sequence. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Decimal))) | Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Double))) | Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Double value. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int32)) | Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Int32 value. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Int32))) | Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Int32 value. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int64)) | Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Int64 value. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Int64))) | Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Int64 value. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Single)) | Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Single value. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Single))) | Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Single value. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Double)) | Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Double value. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Decimal)) | Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Decimal value. (Defined by Enumerable.) |
|
Max(Of KeyValuePair(Of TKey, TValue), TResult)(Func(Of KeyValuePair(Of TKey, TValue), TResult)) | Overloaded. Invokes a transform function on each element of a generic sequence and returns the maximum resulting value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the minimum value in a generic sequence. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Decimal))) | Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Double))) | Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Double value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int32)) | Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Int32 value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Int32))) | Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Int32 value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int64)) | Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Int64 value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Int64))) | Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Int64 value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Single)) | Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Single value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Single))) | Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Single value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Double)) | Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Double value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Decimal)) | Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Decimal value. (Defined by Enumerable.) |
|
Min(Of KeyValuePair(Of TKey, TValue), TResult)(Func(Of KeyValuePair(Of TKey, TValue), TResult)) | Overloaded. Invokes a transform function on each element of a generic sequence and returns the minimum resulting value. (Defined by Enumerable.) |
|
OfType(Of TResult) | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
|
OrderBy(Of KeyValuePair(Of TKey, TValue), TKey)(Func(Of KeyValuePair(Of TKey, TValue), TKey)) | Overloaded. Sorts the elements of a sequence in ascending order according to a key. (Defined by Enumerable.) |
|
OrderBy(Of KeyValuePair(Of TKey, TValue), TKey)(Func(Of KeyValuePair(Of TKey, TValue), TKey), IComparer(Of TKey)) | Overloaded. Sorts the elements of a sequence in ascending order by using a specified comparer. (Defined by Enumerable.) |
|
OrderByDescending(Of KeyValuePair(Of TKey, TValue), TKey)(Func(Of KeyValuePair(Of TKey, TValue), TKey)) | Overloaded. Sorts the elements of a sequence in descending order according to a key. (Defined by Enumerable.) |
|
OrderByDescending(Of KeyValuePair(Of TKey, TValue), TKey)(Func(Of KeyValuePair(Of TKey, TValue), TKey), IComparer(Of TKey)) | Overloaded. Sorts the elements of a sequence in descending order by using a specified comparer. (Defined by Enumerable.) |
|
Reverse(Of KeyValuePair(Of TKey, TValue)) | Inverts the order of the elements in a sequence. (Defined by Enumerable.) |
|
Select(Of KeyValuePair(Of TKey, TValue), TResult)(Func(Of KeyValuePair(Of TKey, TValue), TResult)) | Overloaded. Projects each element of a sequence into a new form. (Defined by Enumerable.) |
|
Select(Of KeyValuePair(Of TKey, TValue), TResult)(Func(Of KeyValuePair(Of TKey, TValue), Int32, TResult)) | Overloaded. Projects each element of a sequence into a new form by incorporating the element's index. (Defined by Enumerable.) |
|
SelectMany(Of KeyValuePair(Of TKey, TValue), TResult)(Func(Of KeyValuePair(Of TKey, TValue), IEnumerable(Of TResult))) | Overloaded. Projects each element of a sequence to an IEnumerable(Of T) and flattens the resulting sequences into one sequence. (Defined by Enumerable.) |
|
SelectMany(Of KeyValuePair(Of TKey, TValue), TResult)(Func(Of KeyValuePair(Of TKey, TValue), Int32, IEnumerable(Of TResult))) | Overloaded. Projects each element of a sequence to an IEnumerable(Of T), and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. (Defined by Enumerable.) |
|
SelectMany(Of KeyValuePair(Of TKey, TValue), TCollection, TResult)(Func(Of KeyValuePair(Of TKey, TValue), Int32, IEnumerable(Of TCollection)), Func(Of KeyValuePair(Of TKey, TValue), TCollection, TResult)) | Overloaded. Projects each element of a sequence to an IEnumerable(Of T), flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element. (Defined by Enumerable.) |
|
SelectMany(Of KeyValuePair(Of TKey, TValue), TCollection, TResult)(Func(Of KeyValuePair(Of TKey, TValue), IEnumerable(Of TCollection)), Func(Of KeyValuePair(Of TKey, TValue), TCollection, TResult)) | Overloaded. Projects each element of a sequence to an IEnumerable(Of T), flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. (Defined by Enumerable.) |
|
SequenceEqual(Of KeyValuePair(Of TKey, TValue))(IEnumerable(Of KeyValuePair(Of TKey, TValue))) | Overloaded. Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type. (Defined by Enumerable.) |
|
SequenceEqual(Of KeyValuePair(Of TKey, TValue))(IEnumerable(Of KeyValuePair(Of TKey, TValue)), IEqualityComparer(Of KeyValuePair(Of TKey, TValue))) | Overloaded. Determines whether two sequences are equal by comparing their elements by using a specified IEqualityComparer(Of T). (Defined by Enumerable.) |
|
Single(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence. (Defined by Enumerable.) |
|
Single(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists. (Defined by Enumerable.) |
|
SingleOrDefault(Of KeyValuePair(Of TKey, TValue)) | Overloaded. Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence. (Defined by Enumerable.) |
|
SingleOrDefault(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Defined by Enumerable.) |
|
Skip(Of KeyValuePair(Of TKey, TValue)) | Bypasses a specified number of elements in a sequence and then returns the remaining elements. (Defined by Enumerable.) |
|
SkipWhile(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. (Defined by Enumerable.) |
|
SkipWhile(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int32, Boolean)) | Overloaded. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function. (Defined by Enumerable.) |
|
Sum(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Decimal))) | Overloaded. Computes the sum of the sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Sum(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Double))) | Overloaded. Computes the sum of the sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Sum(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int32)) | Overloaded. Computes the sum of the sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Sum(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Int32))) | Overloaded. Computes the sum of the sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Sum(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int64)) | Overloaded. Computes the sum of the sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Sum(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Int64))) | Overloaded. Computes the sum of the sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Sum(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Single)) | Overloaded. Computes the sum of the sequence of Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Sum(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Nullable(Of Single))) | Overloaded. Computes the sum of the sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Sum(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Double)) | Overloaded. Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Sum(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Decimal)) | Overloaded. Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.) |
|
Take(Of KeyValuePair(Of TKey, TValue)) | Returns a specified number of contiguous elements from the start of a sequence. (Defined by Enumerable.) |
|
TakeWhile(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Returns elements from a sequence as long as a specified condition is true. (Defined by Enumerable.) |
|
TakeWhile(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int32, Boolean)) | Overloaded. Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function. (Defined by Enumerable.) |
|
ToArray(Of KeyValuePair(Of TKey, TValue)) | Creates an array from a IEnumerable(Of T). (Defined by Enumerable.) |
|
ToDictionary(Of KeyValuePair(Of TKey, TValue), TKey)(Func(Of KeyValuePair(Of TKey, TValue), TKey)) | Overloaded. Creates a Dictionary(Of TKey, TValue) from an IEnumerable(Of T) according to a specified key selector function. (Defined by Enumerable.) |
|
ToDictionary(Of KeyValuePair(Of TKey, TValue), TKey)(Func(Of KeyValuePair(Of TKey, TValue), TKey), IEqualityComparer(Of TKey)) | Overloaded. Creates a Dictionary(Of TKey, TValue) from an IEnumerable(Of T) according to a specified key selector function and key comparer. (Defined by Enumerable.) |
|
ToDictionary(Of KeyValuePair(Of TKey, TValue), TKey, TElement)(Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of KeyValuePair(Of TKey, TValue), TElement)) | Overloaded. Creates a Dictionary(Of TKey, TValue) from an IEnumerable(Of T) according to specified key selector and element selector functions. (Defined by Enumerable.) |
|
ToDictionary(Of KeyValuePair(Of TKey, TValue), TKey, TElement)(Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of KeyValuePair(Of TKey, TValue), TElement), IEqualityComparer(Of TKey)) | Overloaded. Creates a Dictionary(Of TKey, TValue) from an IEnumerable(Of T) according to a specified key selector function, a comparer, and an element selector function. (Defined by Enumerable.) |
|
ToList(Of KeyValuePair(Of TKey, TValue)) | Creates a List(Of T) from an IEnumerable(Of T). (Defined by Enumerable.) |
|
ToLookup(Of KeyValuePair(Of TKey, TValue), TKey)(Func(Of KeyValuePair(Of TKey, TValue), TKey)) | Overloaded. Creates a Lookup(Of TKey, TElement) from an IEnumerable(Of T) according to a specified key selector function. (Defined by Enumerable.) |
|
ToLookup(Of KeyValuePair(Of TKey, TValue), TKey)(Func(Of KeyValuePair(Of TKey, TValue), TKey), IEqualityComparer(Of TKey)) | Overloaded. Creates a Lookup(Of TKey, TElement) from an IEnumerable(Of T) according to a specified key selector function and key comparer. (Defined by Enumerable.) |
|
ToLookup(Of KeyValuePair(Of TKey, TValue), TKey, TElement)(Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of KeyValuePair(Of TKey, TValue), TElement)) | Overloaded. Creates a Lookup(Of TKey, TElement) from an IEnumerable(Of T) according to specified key selector and element selector functions. (Defined by Enumerable.) |
|
ToLookup(Of KeyValuePair(Of TKey, TValue), TKey, TElement)(Func(Of KeyValuePair(Of TKey, TValue), TKey), Func(Of KeyValuePair(Of TKey, TValue), TElement), IEqualityComparer(Of TKey)) | Overloaded. Creates a Lookup(Of TKey, TElement) from an IEnumerable(Of T) according to a specified key selector function, a comparer and an element selector function. (Defined by Enumerable.) |
|
Union(Of KeyValuePair(Of TKey, TValue))(IEnumerable(Of KeyValuePair(Of TKey, TValue))) | Overloaded. Produces the set union of two sequences by using the default equality comparer. (Defined by Enumerable.) |
|
Union(Of KeyValuePair(Of TKey, TValue))(IEnumerable(Of KeyValuePair(Of TKey, TValue)), IEqualityComparer(Of KeyValuePair(Of TKey, TValue))) | Overloaded. Produces the set union of two sequences by using a specified IEqualityComparer(Of T). (Defined by Enumerable.) |
|
Where(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Boolean)) | Overloaded. Filters a sequence of values based on a predicate. (Defined by Enumerable.) |
|
Where(Of KeyValuePair(Of TKey, TValue))(Func(Of KeyValuePair(Of TKey, TValue), Int32, Boolean)) | Overloaded. Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. (Defined by Enumerable.) |
|
Zip(Of KeyValuePair(Of TKey, TValue), TSecond, TResult) | Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results. (Defined by Enumerable.) |
| Name | Description | |
|---|---|---|
|
ICollection(Of KeyValuePair(Of TKey, TValue)).Add | Adds an item to the collection. |
|
ICollection(Of KeyValuePair(Of TKey, TValue)).Contains | Gets whether the ICollection contains an element with the specified key. |
|
ICollection(Of KeyValuePair(Of TKey, TValue)).CopyTo | Copies the elements of the ICollection to an array, starting at the specified array index. |
|
ICollection.CopyTo | Copies the elements of the ICollection to an array, starting at the specified array index. |
|
ICollection(Of KeyValuePair(Of TKey, TValue)).IsReadOnly | Gets a value indicating whether the ICollection is read-only. |
|
ICollection.IsSynchronized | Gets a value indicating whether access to the ICollection is synchronized with the SyncRoot. |
|
ICollection(Of KeyValuePair(Of TKey, TValue)).Remove | Removes the specified key/value pair from the collection. |
|
ICollection.SyncRoot | Gets an object that can be used to synchronize access to the ICollection. This property is not supported. |
|
IDictionary(Of TKey, TValue).Add | Adds the specified key and value to the IDictionary(Of TKey, TValue). |
|
IDictionary.Add | Adds the specified key and value to the dictionary. |
|
IDictionary.Contains | Gets whether the IDictionary(Of TKey, TValue) contains an element with the specified key. |
|
IDictionary.GetEnumerator | Provides an IDictionaryEnumerator for the IDictionary(Of TKey, TValue). |
|
IDictionary.IsFixedSize | Gets a value indicating whether the IDictionary(Of TKey, TValue) has a fixed size. |
|
IDictionary.IsReadOnly | Gets a value indicating whether the IDictionary(Of TKey, TValue) is read-only. |
|
IDictionary.Item | Gets or sets the value associated with the specified key. |
|
IDictionary.Keys | Gets an ICollection containing the keys of the IDictionary(Of TKey, TValue). |
|
IDictionary(Of TKey, TValue).Remove | Removes the element with the specified key from the IDictionary(Of TKey, TValue). |
|
IDictionary.Remove | Removes the element with the specified key from the IDictionary. |
|
IDictionary.Values | Gets an ICollection containing the values in the IDictionary. |
|
IEnumerable.GetEnumerator | Returns an enumerator that iterates through the ConcurrentDictionary(Of TKey, TValue). |
Note
|
|---|
|
The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: Synchronization | ExternalThreading. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes. |
The following example shows how to construct a ConcurrentDictionary(Of TKey, TValue):
class CD_Ctor { // Demonstrates: // ConcurrentDictionary<TKey, TValue> ctor(concurrencyLevel, initialCapacity) // ConcurrentDictionary<TKey, TValue>[TKey] static void Main() { // We know how many items we want to insert into the ConcurrentDictionary. // So set the initial capacity to some prime number above that, to ensure that // the ConcurrentDictionary does not need to be resized while initializing it. int NUMITEMS = 64; int initialCapacity = 101; // The higher the concurrencyLevel, the higher the theoretical number of operations // that could be performed concurrently on the ConcurrentDictionary. However, global // operations like resizing the dictionary take longer as the concurrencyLevel rises. // For the purposes of this example, we'll compromise at numCores * 2. int numProcs = Environment.ProcessorCount; int concurrencyLevel = numProcs * 2; // Construct the dictionary with the desired concurrencyLevel and initialCapacity ConcurrentDictionary<int, int> cd = new ConcurrentDictionary<int, int>(concurrencyLevel, initialCapacity); // Initialize the dictionary for (int i = 0; i < NUMITEMS; i++) cd[i] = i * i; Console.WriteLine("The square of 23 is {0} (should be {1})", cd[23], 23 * 23); } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
