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>
Public Interface IIndex(Of 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
| Name | Description |
---|
| Item |
Get the value associated with key.
|
TopMethods
| Name | Description |
---|
| TryGetValue |
Get the value associated with key if any is available.
|
TopExamples
Retrieving a value given a key:
IIndex<AccountType, IRenderer> accountRenderers =
var renderer = accountRenderers[AccountType.User];
See Also