Class ReadOnlyDictionaryExtensionMethods
- Namespace
- SodaFlow.Functional
- Assembly
- SodaFlow.Functional.dll
The lookup operations on a read-only dictionary which answer with a Maybe<T>.
[PublicAPI]
public static class ReadOnlyDictionaryExtensionMethods
- Inheritance
-
ReadOnlyDictionaryExtensionMethods
- Inherited Members
Remarks
These are on IReadOnlyDictionary<TKey, TValue> and not also on IDictionary<TKey, TValue> on purpose. Almost each dictionary implements the two interfaces, and an overload for each makes each call on a concrete Dictionary<TKey, TValue> ambiguous. Where only an IDictionary<TKey, TValue> is in hand, use FromTryGet<T, TResult>(T, TryGet<T, TResult>) as an alternative.
Methods
- TryGetValue<TKey, TValue>(IReadOnlyDictionary<TKey, TValue>?, TKey)
Gives the value stored for a key, if there is one.