Skip to content

SecondaryIndex class

Attributes: [DebuggerDisplay("SecondaryIndex: {_shards}")]

Defined in

Namespace: ReactiveList.Reactive.Core Assembly: ReactiveList.Reactive.dll Full name: ReactiveList.Reactive.Core.SecondaryIndex<T1, T2> Modifiers: public sealed

Summary

View source (opens in a new tab)

Provides a thread-safe secondary index for associating items with keys derived from a selector function.

Applies to

net11.0, net10.0, net47, net471, net472, net48, net481

Class hierarchy
classDiagram
class SecondaryIndex~T1,T2~
class ISecondaryIndex~T~ {
    <>
}
ISecondaryIndex~T~ <|.. SecondaryIndex~T1,T2~

Implements: ISecondaryIndex

Remarks

The index is a multiset: an item added twice is returned twice by Lookup and must be removed twice. The key is computed when an item is added. If an item's key changes afterwards, OnRemoved still finds and removes the stale entry, but lookups reflect the key the item had when it was added.

Constructors

NameSummary
.ctorProvides a thread-safe secondary index for associating items with keys derived from a selector function.

Methods

NameSummary
OnAddedAdds the specified item to the collection.
OnRemovedRemoves the specified item from the collection.
OnUpdatedHandles the update of an item.
LookupRetrieves all values associated with the specified key.
ClearRemoves all items from the collection.
MatchesKeyDetermines whether the specified item's key matches the provided key object.
Inherited members