public static Option <KeyValuePair <TKey, TValue> > Single <TKey, TValue>(this Dictionary <TKey, TValue> source)
            where TKey : notnull
#pragma warning disable HLQ005 // Avoid Single() and SingleOrDefault()
        => ValueReadOnlyCollectionExtensions.Single <ValueWrapper <TKey, TValue>, Dictionary <TKey, TValue> .Enumerator, KeyValuePair <TKey, TValue> >(new ValueWrapper <TKey, TValue>(source));
 public static Option <TKey> Single <TKey, TValue>(this SortedDictionary <TKey, TValue> .KeyCollection source)
 => ValueReadOnlyCollectionExtensions.Single <ValueWrapper <TKey, TValue>, SortedDictionary <TKey, TValue> .KeyCollection.Enumerator, TKey>(new ValueWrapper <TKey, TValue>(source));
        public static Option <TSource> Single <TSource>(this ImmutableHashSet <TSource> source)
#pragma warning disable HLQ005 // Avoid Single() and SingleOrDefault()
        => ValueReadOnlyCollectionExtensions.Single <ValueWrapper <TSource>, ImmutableHashSet <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source));
Beispiel #4
0
 public static Option <TSource> Single <TSource>(this ImmutableHashSet <TSource> source)
 => ValueReadOnlyCollectionExtensions.Single <ValueWrapper <TSource>, ImmutableHashSet <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source));
Beispiel #5
0
 public static Option <KeyValuePair <TKey, TValue> > Single <TKey, TValue>(this SortedDictionary <TKey, TValue> source)
     where TKey : notnull
 => ValueReadOnlyCollectionExtensions.Single <ValueWrapper <TKey, TValue>, SortedDictionary <TKey, TValue> .Enumerator, KeyValuePair <TKey, TValue> >(new ValueWrapper <TKey, TValue>(source));
Beispiel #6
0
 public static Option <TValue> Single <TKey, TValue>(this Dictionary <TKey, TValue> .ValueCollection source)
     where TKey : notnull
 => ValueReadOnlyCollectionExtensions.Single <ValueWrapper <TKey, TValue>, Dictionary <TKey, TValue> .ValueCollection.Enumerator, TValue>(new ValueWrapper <TKey, TValue>(source));