forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDictionaryExtensions.cs
More file actions
30 lines (25 loc) · 986 Bytes
/
DictionaryExtensions.cs
File metadata and controls
30 lines (25 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using Proxy = ServiceStack.Common.DictionaryExtensions;
namespace ServiceStack.Common.Extensions
{
public static class DictionaryExtensions
{
public static TValue GetValueOrDefault<TValue, TKey>(this Dictionary<TKey, TValue> dictionary, TKey key)
{
return Proxy.GetValueOrDefault(dictionary, key);
}
public static void ForEach<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, Action<TKey, TValue> onEachFn)
{
Proxy.ForEach(dictionary, onEachFn);
}
public static bool EquivalentTo<K, V>(this IDictionary<K, V> thisMap, IDictionary<K, V> otherMap)
{
return Proxy.EquivalentTo(thisMap, otherMap);
}
public static List<T> ConvertAll<T, K, V>(IDictionary<K, V> map, Func<K, V, T> createFn)
{
return Proxy.ConvertAll(map, createFn);
}
}
}