From 90153bd7cd3bfccc99e37c1c2ca0e20cc7187c26 Mon Sep 17 00:00:00 2001 From: "lw@mi24" Date: Sat, 16 Mar 2024 11:51:47 +0800 Subject: [PATCH] =?UTF-8?q?support=20for=20enum=20type=20of=20db=20/?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20=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 ee49c2abd..b8a8cd29e 100644 --- a/Dapper/SqlMapper.cs +++ b/Dapper/SqlMapper.cs @@ -367,7 +367,7 @@ public static void SetDbType(IDataParameter parameter, object value) handler = null; var nullUnderlyingType = Nullable.GetUnderlyingType(type); if (nullUnderlyingType != null) type = nullUnderlyingType; - if (type.IsEnum && !typeMap.ContainsKey(type)) + if (type.IsEnum && !typeMap.ContainsKey(type) && !typeHandlers.ContainsKey(type)) { type = Enum.GetUnderlyingType(type); }