Visitar URL original
Don't use IReadOnlyDictionary because of mono · ncoder/npgsql@3cd6e61 · GitHub
Skip to content

Commit 3cd6e61

Browse files
author
Shay Rojansky
committed
Don't use IReadOnlyDictionary because of mono
In mono 4.2, ConcurrentDictionary doesn't implement IReadOnlyDictionary and so Npgsql bombs. Fixes npgsql#875
1 parent fbb4331 commit 3cd6e61

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎src/Npgsql/TypeHandlerRegistry.cs‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,10 @@ internal partial class TypeHandlerRegistry
7474
static readonly ConcurrentDictionary<string, List<BackendType>> BackendTypeCache = new ConcurrentDictionary<string, List<BackendType>>();
7575

7676
static readonly ConcurrentDictionary<string, TypeHandler> _globalEnumMappings;
77-
78-
internal static IReadOnlyDictionary<string, TypeHandler> GlobalEnumMappings
79-
=> (IReadOnlyDictionary<string, TypeHandler>)_globalEnumMappings;
80-
8177
static readonly ConcurrentDictionary<string, TypeHandler> _globalCompositeMappings;
8278

83-
internal static IReadOnlyDictionary<string, TypeHandler> GlobalCompositeMappings
84-
=> (IReadOnlyDictionary<string, TypeHandler>)_globalCompositeMappings;
79+
internal static IDictionary<string, TypeHandler> GlobalEnumMappings => _globalEnumMappings;
80+
internal static IDictionary<string, TypeHandler> GlobalCompositeMappings => _globalCompositeMappings;
8581

8682
static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
8783

0 commit comments

Comments
 (0)