Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dapper NET40/SqlMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ public static DbType GetDbType(object value)
internal static DbType LookupDbType(Type type, string name, bool demand, out ITypeHandler handler)
{
DbType dbType;
handler = null;
typeHandlers.TryGetValue(type, out handler);
var nullUnderlyingType = Nullable.GetUnderlyingType(type);
if (nullUnderlyingType != null) type = nullUnderlyingType;
if (type.IsEnum() && !typeMap.ContainsKey(type))
Expand All @@ -940,7 +940,7 @@ internal static DbType LookupDbType(Type type, string name, bool demand, out ITy
{
return DbType.Binary;
}
if (typeHandlers.TryGetValue(type, out handler))
if (handler == null)
{
return DbType.Object;
}
Expand Down