Click or drag to resize

IIndexTKey, TValue Interface

Provides components by lookup operations via an index (key) type.

Namespace:  Autofac.Features.Indexed
Assembly:  Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
Syntax
public interface IIndex<in TKey, TValue>

Type Parameters

TKey
The type of the index.
TValue
The service provided by the indexed components.

The IIndexTKey, TValue type exposes the following members.

Properties
  NameDescription
Public propertyItem
Get the value associated with key.
Top
Methods
  NameDescription
Public methodTryGetValue
Get the value associated with key if any is available.
Top
Examples
Retrieving a value given a key:
IIndex<AccountType, IRenderer> accountRenderers = // ...
var renderer = accountRenderers[AccountType.User];
See Also