Fix Collections.SingletonMap for .NET 4.5

This commit is contained in:
Sam Harwell 2013-02-27 13:08:31 -06:00
parent 5af2411849
commit ca133e541d
1 changed files with 4 additions and 0 deletions

View File

@ -59,7 +59,11 @@ namespace Sharpen
public static IDictionary<TKey, TValue> SingletonMap<TKey, TValue>(TKey key, TValue value)
#endif
{
#if NET_4_5
return new ReadOnlyDictionary<TKey,TValue>(new Dictionary<TKey, TValue> { { key, value } });
#else
return new Dictionary<TKey, TValue> { { key, value } };
#endif
}
private static class EmptyListImpl<T>