From bbbdc903de4a2f09b920535a9ae6290d59912095 Mon Sep 17 00:00:00 2001 From: lw Date: Fri, 22 Mar 2024 15:18:32 +0800 Subject: [PATCH] =?UTF-8?q?support=20for=20enum=20type=20of=20db=20/?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=95=B0=E6=8D=AE=E5=BA=93=20enum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dapper/SqlMapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }