Skip to content

Commit

Permalink
Added a few missing data type mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuck committed Feb 3, 2021
1 parent 120cd20 commit 02d4300
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/YuckQi.Data.Sql.Dapper/YuckQi.Data.Sql.Dapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>0.4.9</Version>
<Version>0.4.10</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Description>An implementation of YuckQi.Data using Dapper and SimpleCRUD.</Description>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>0.4.9</Version>
<Version>0.4.10</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Description>An implementation of YuckQi.Data using Entity Framework.</Description>
</PropertyGroup>
Expand Down
10 changes: 8 additions & 2 deletions src/YuckQi.Data/Extensions/DataParameterExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ public static class DataParameterExtensions
{
private static readonly IReadOnlyDictionary<Type, DbType> DbTypeMap = new Dictionary<Type, DbType>
{
{ typeof(string), DbType.AnsiString },
{ typeof(bool), DbType.Boolean },
{ typeof(byte), DbType.Byte },
{ typeof(DateTime), DbType.DateTime2 },
{ typeof(DateTimeOffset), DbType.DateTimeOffset },
{ typeof(decimal), DbType.Decimal },
{ typeof(double), DbType.Double },
{ typeof(float), DbType.Single },
{ typeof(Guid), DbType.Guid },
{ typeof(int), DbType.Int32 },
{ typeof(long), DbType.Int64 }
{ typeof(long), DbType.Int64 },
{ typeof(string), DbType.AnsiString }
};

public static IReadOnlyCollection<T> ToParameterCollection<T>(this object parameters, IReadOnlyDictionary<Type, DbType> dbTypeMap = null) where T : IDataParameter, new()
Expand Down
2 changes: 1 addition & 1 deletion src/YuckQi.Data/YuckQi.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kevin J Lambert</Authors>
<Version>0.4.9</Version>
<Version>0.4.10</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Description>A .NET library providing fine-grained data providers useful in data repository or domain service implementations.</Description>
</PropertyGroup>
Expand Down

0 comments on commit 02d4300

Please sign in to comment.