From eb4a50363bdbd315f7a42bd3478ccfa244bd17ea Mon Sep 17 00:00:00 2001 From: Marc Gravell Date: Fri, 12 Apr 2024 10:34:10 +0100 Subject: [PATCH] revert #2050 - see #2049 for more details --- Dapper/SqlMapper.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Dapper/SqlMapper.cs b/Dapper/SqlMapper.cs index 5575a6f5..f624f1e9 100644 --- a/Dapper/SqlMapper.cs +++ b/Dapper/SqlMapper.cs @@ -193,9 +193,7 @@ public TypeMapEntry(DbType dbType, TypeMapEntryFlags flags) public static readonly TypeMapEntry DoNotSet = new((DbType)(-2), TypeMapEntryFlags.None), DoNotSetFieldValue = new((DbType)(-2), TypeMapEntryFlags.UseGetFieldValue), - DecimalFieldValue = new(DbType.Decimal, TypeMapEntryFlags.SetType | TypeMapEntryFlags.UseGetFieldValue), - StringFieldValue = new(DbType.String, TypeMapEntryFlags.SetType | TypeMapEntryFlags.UseGetFieldValue), - BinaryFieldValue = new(DbType.Binary, TypeMapEntryFlags.SetType | TypeMapEntryFlags.UseGetFieldValue); + DecimalFieldValue = new(DbType.Decimal, TypeMapEntryFlags.SetType | TypeMapEntryFlags.UseGetFieldValue); public static implicit operator TypeMapEntry(DbType dbType) => new(dbType, TypeMapEntryFlags.SetType); @@ -221,13 +219,13 @@ static SqlMapper() [typeof(double)] = DbType.Double, [typeof(decimal)] = DbType.Decimal, [typeof(bool)] = DbType.Boolean, - [typeof(string)] = TypeMapEntry.StringFieldValue, + [typeof(string)] = DbType.String, [typeof(char)] = DbType.StringFixedLength, [typeof(Guid)] = DbType.Guid, [typeof(DateTime)] = TypeMapEntry.DoNotSet, [typeof(DateTimeOffset)] = DbType.DateTimeOffset, [typeof(TimeSpan)] = TypeMapEntry.DoNotSet, - [typeof(byte[])] = TypeMapEntry.BinaryFieldValue, + [typeof(byte[])] = DbType.Binary, [typeof(byte?)] = DbType.Byte, [typeof(sbyte?)] = DbType.SByte, [typeof(short?)] = DbType.Int16,