diff --git a/Dapper NET40/SqlMapper.cs b/Dapper NET40/SqlMapper.cs
index 24c78f6d8..228a0562c 100644
--- a/Dapper NET40/SqlMapper.cs
+++ b/Dapper NET40/SqlMapper.cs
@@ -2154,6 +2154,12 @@ static readonly MethodInfo
.Where(p => p.GetIndexParameters().Any() && p.GetIndexParameters()[0].ParameterType == typeof(int))
.Select(p => p.GetGetMethod()).First();
+ ///
+ /// Gets type-map for the given type
+ ///
+ /// Type map instance, default is to create new instance of DefaultTypeMap
+ public static Func TypeMapProvider = ( Type type ) => new DefaultTypeMap( type );
+
///
/// Gets type-map for the given type
///
@@ -2170,7 +2176,7 @@ public static ITypeMap GetTypeMap(Type type)
map = (ITypeMap)_typeMaps[type];
if (map == null)
{
- map = new DefaultTypeMap(type);
+ map = TypeMapProvider( type );
_typeMaps[type] = map;
}
}