Skip to content

Commit 90153bd

Browse files
committed
support for enum type of db /支持 数据库 enum
1 parent 62a526b commit 90153bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dapper/SqlMapper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ public static void SetDbType(IDataParameter parameter, object value)
367367
handler = null;
368368
var nullUnderlyingType = Nullable.GetUnderlyingType(type);
369369
if (nullUnderlyingType != null) type = nullUnderlyingType;
370-
if (type.IsEnum && !typeMap.ContainsKey(type))
370+
if (type.IsEnum && !typeMap.ContainsKey(type) && !typeHandlers.ContainsKey(type))
371371
{
372372
type = Enum.GetUnderlyingType(type);
373373
}

0 commit comments

Comments
 (0)