Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>.Item[TAlternateKey] Property

Definition

Gets or sets the value associated with the specified alternate key.

C#
public TValue this[TAlternateKey key] { get; set; }

Parameters

key
TAlternateKey

The alternate key of the value to get or set.

Property Value

TValue

The value associated with the specified alternate key. If the specified alternate key is not found, a get operation throws a KeyNotFoundException, and a set operation creates a new element with the specified key.

Exceptions

key is null.

The property is retrieved and alternate key does not exist in the collection.

Applies to

Produkt Versioner
.NET 9, 10