Table of Contents

Class ImmutableEquatableDictionary<TKey, TValue>

Namespace
PolyType.Roslyn
Assembly
PolyType.Roslyn.dll

Defines an immutable dictionary that defines structural equality semantics.

public sealed class ImmutableEquatableDictionary<TKey, TValue> : IEquatable<ImmutableEquatableDictionary<TKey, TValue>>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable where TKey : IEquatable<TKey> where TValue : IEquatable<TValue>

Type Parameters

TKey

The key type of the dictionary.

TValue

The value type of the dictionary.

Inheritance
ImmutableEquatableDictionary<TKey, TValue>
Implements
IDictionary<TKey, TValue>
ICollection<KeyValuePair<TKey, TValue>>
IReadOnlyDictionary<TKey, TValue>
IEnumerable<KeyValuePair<TKey, TValue>>
Inherited Members
Extension Methods

Properties

Count

Gets the number of key/value pairs in the dictionary.

public int Count { get; }

Property Value

int

Empty

public static ImmutableEquatableDictionary<TKey, TValue> Empty { get; }

Property Value

ImmutableEquatableDictionary<TKey, TValue>

this[TKey]

Gets the value associated with the specified key.

public TValue this[TKey key] { get; }

Parameters

key TKey

Property Value

TValue

Keys

Gets a collection containing the keys in the dictionary.

public Dictionary<TKey, TValue>.KeyCollection Keys { get; }

Property Value

Dictionary<TKey, TValue>.KeyCollection

Values

Gets a collection containing the values in the dictionary.

public Dictionary<TKey, TValue>.ValueCollection Values { get; }

Property Value

Dictionary<TKey, TValue>.ValueCollection

Methods

ContainsKey(TKey)

Determines whether the dictionary contains the specified key.

public bool ContainsKey(TKey key)

Parameters

key TKey

Returns

bool

Equals(ImmutableEquatableDictionary<TKey, TValue>)

public bool Equals(ImmutableEquatableDictionary<TKey, TValue> other)

Parameters

other ImmutableEquatableDictionary<TKey, TValue>

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetEnumerator()

Gets an enumerator that iterates through the dictionary.

public Dictionary<TKey, TValue>.Enumerator GetEnumerator()

Returns

Dictionary<TKey, TValue>.Enumerator

GetHashCode()

public override int GetHashCode()

Returns

int

TryGetValue(TKey, out TValue)

Try to get the value associated with the specified key.

public bool TryGetValue(TKey key, out TValue value)

Parameters

key TKey
value TValue

Returns

bool