44
55static class DictionaryExtensions
66{
7- public static void Add < TKey , TValue > ( this IDictionary < TKey , List < TValue > > dictionary , TKey key , TValue value )
7+ public static void Add < TKey , TValue > ( this Dictionary < TKey , List < TValue > > dictionary , TKey key , TValue value )
88 {
99 dictionary . AddOrGet ( key ) . Add ( value ) ;
1010 }
1111
12- public static TValue AddOrGet < TKey , TValue > ( this IDictionary < TKey , TValue > dictionary , TKey key )
12+ public static TValue AddOrGet < TKey , TValue > ( this Dictionary < TKey , TValue > dictionary , TKey key )
1313 where TValue : new ( )
1414 {
1515 return dictionary . AddOrGet ( key , ( ) => new TValue ( ) ) ;
1616 }
1717
18- public static TValue AddOrGet < TKey , TValue > ( this IDictionary < TKey , TValue > dictionary , TKey key , Func < TValue > newValue )
18+ public static TValue AddOrGet < TKey , TValue > ( this Dictionary < TKey , TValue > dictionary , TKey key , Func < TValue > newValue )
1919 {
2020 TValue result ;
2121
@@ -28,7 +28,11 @@ public static TValue AddOrGet<TKey, TValue>(this IDictionary<TKey, TValue> dicti
2828 return result ;
2929 }
3030
31+ #if NET35
3132 public static bool Contains < TKey , TValue > ( this IDictionary < TKey , List < TValue > > dictionary , TKey key , TValue value , IEqualityComparer < TValue > valueComparer )
33+ #else
34+ public static bool Contains < TKey , TValue > ( this IReadOnlyDictionary < TKey , List < TValue > > dictionary , TKey key , TValue value , IEqualityComparer < TValue > valueComparer )
35+ #endif
3236 {
3337 List < TValue > values ;
3438
0 commit comments