Skip to content

Commit 330925f

Browse files
support for enum type of db /支持 数据库 enum
1 parent 62a526b commit 330925f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Dapper/Dapper.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Description>A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..</Description>
77
<Authors>Sam Saffron;Marc Gravell;Nick Craver</Authors>
88
<TargetFrameworks>net461;netstandard2.0;net5.0</TargetFrameworks>
9+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
910
</PropertyGroup>
1011
<ItemGroup>
1112
<Folder Include="Properties\" />

Dapper/SqlMapper.cs

Lines changed: 1 addition & 1 deletion
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)