Table of Contents

Enum DictionaryInsertionMode

Namespace
PolyType.Abstractions
Assembly
PolyType.dll

Specifies insertion behavior for a mutable dictionary type.

[Flags]
public enum DictionaryInsertionMode

Fields

Discard = 2

Discards the new value when the key already exists.

Canonically maps to the "TryAdd" method of the dictionary, falling back to a combination of "ContainsKey"/"Add" calls if the former is not available.

None = 0

No specific insertion behavior is specified.

When passed to GetInserter(DictionaryInsertionMode), picks any available insertion method offered by the dictionary.

Overwrite = 1

Overwrites the existing value with the new value when the key already exists.

Canonically maps to the indexer of the dictionary.

Throw = 4

Throws an exception when the key already exists.

Canonically maps to the "Add" method of the dictionary.