DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="5.8.0" />

 ReadOnlyDictionaryView<TKey, TInput, TOutput>

public struct ReadOnlyDictionaryView<TKey, TInput, TOutput> : IReadOnlyDictionary<TKey, TOutput>, IEnumerable<KeyValuePair<TKey, TOutput>>, IEnumerable, IReadOnlyCollection<KeyValuePair<TKey, TOutput>>, IEquatable<ReadOnlyDictionaryView<TKey, TInput, TOutput>>
Represents lazily converted read-only dictionary.
public int Count { get; }

Count of key/value pairs.

public TOutput this[TKey key] { get; }

Gets value associated with the key and convert it.

public IEnumerable<TKey> Keys { get; }

All dictionary keys.

public IEnumerable<TOutput> Values { get; }

All converted dictionary values.

public ReadOnlyDictionaryView(IReadOnlyDictionary<TKey, TInput> dictionary, Func<TInput, TOutput> mapper)

Represents lazily converted read-only dictionary.

public ReadOnlyDictionaryView(IReadOnlyDictionary<TKey, TInput> dictionary, Converter<TInput, TOutput> mapper)

Initializes a new lazily converted view.

public static bool op_Equality(ref ReadOnlyDictionaryView first, ref ReadOnlyDictionaryView second)

Determines whether two views are same.

public static bool op_Inequality(ref ReadOnlyDictionaryView first, ref ReadOnlyDictionaryView second)

Determines whether two views are not same.

public bool ContainsKey(TKey key)

Determines whether the wrapped dictionary contains an element with the specified key.

public bool Equals(ReadOnlyDictionaryView<TKey, TInput, TOutput> other)

Determines whether two converted dictionaries are same.

public IEnumerator<KeyValuePair<TKey, TOutput>> GetEnumerator()

Returns enumerator over key/value pairs in the wrapped dictionary and performs conversion for each value in the pair.

public bool TryGetValue(TKey key, out TOutput value)

Returns the converted value associated with the specified key.