IQuaternaryDictionary.AddValueIndex(string, Func) method¶
Defined in
Type: IQuaternaryDictionaryReactiveList.Reactive.Collections
Assembly: ReactiveList.Reactive.dll
Applies to
net11.0, net10.0, net47, net471, net472, net48, net481
void AddValueIndex<TIndexKey>(string indexName, Func<TValue?, TIndexKey> keySelector) where TIndexKey : notnull
Summary: Adds a value index with the specified name, using the provided key selector to generate index keys for values.
Type parameters
| Name | Description |
|---|---|
TIndexKey | The type of the key used for indexing. Must be non-nullable. |
Parameters
| Name | Type | Description |
|---|---|---|
indexName | string (opens in a new tab) | The unique name of the value index to add. Cannot be null or empty. |
keySelector | Func | A function that extracts the index key from a value. Cannot be null. |
Remarks
Value indexes enable efficient lookups and queries based on the key generated by the key selector. Adding an index with a duplicate name may result in an error or overwrite, depending on the implementation.