diff --git a/Dapper/SqlMapper.cs b/Dapper/SqlMapper.cs index 5575a6f5f..ed1644462 100644 --- a/Dapper/SqlMapper.cs +++ b/Dapper/SqlMapper.cs @@ -447,7 +447,7 @@ public static void SetDbType(IDataParameter parameter, object value) handler = null; var nullUnderlyingType = Nullable.GetUnderlyingType(type); if (nullUnderlyingType is not null) type = nullUnderlyingType; - if (type.IsEnum && !typeMap.ContainsKey(type)) + if (type.IsEnum && !typeMap.ContainsKey(type) && !typeHandlers.ContainsKey(type)) { type = Enum.GetUnderlyingType(type); }