Skip to content

Applies to

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

public void Edit(Action<IDictionary<TKey, TValue>> editAction)

View source (opens in a new tab)

Summary: Performs a batch edit operation on the dictionary, ensuring only a single change notification is emitted.

Parameters

NameTypeDescription
editActionAction> (opens in a new tab)An action that receives the dictionary interface to perform modifications.

Remarks

The action runs while every shard is write-locked, so it must not call back into the dictionary. If it throws, the edits made so far stay applied, the count and indexes are updated, and the notification is still emitted.

Exceptions

TypeCondition
System.ArgumentNullException (opens in a new tab)editAction is null.