Skip to content

Commit

Permalink
revert #2050 - see #2049 for more details
Browse files Browse the repository at this point in the history
  • Loading branch information
mgravell committed Apr 12, 2024
1 parent ad16263 commit eb4a503
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Dapper/SqlMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand Down

0 comments on commit eb4a503

Please sign in to comment.