From 62bdcd1bb2dab3afbc86d0579feb28beba8b93ce Mon Sep 17 00:00:00 2001 From: Marc Gravell Date: Thu, 28 Aug 2014 09:53:16 +0100 Subject: [PATCH] 1.33: SqlGeometry (core) and DbGeometry (EF) support --- Dapper NET40/Properties/AssemblyInfo.cs | 4 +- Dapper NET40/SqlMapper.cs | 11 +++-- .../Properties/AssemblyInfo.cs | 4 +- Dapper.Contrib/Properties/AssemblyInfo.cs | 4 +- .../Dapper.EntityFramework NET40.csproj | 10 ++++- .../Properties/AssemblyInfo.cs | 36 --------------- .../Dapper.EntityFramework NET45.csproj | 1 + .../DbGeometryHandler.cs | 45 +++++++++++++++++++ Dapper.EntityFramework NET45/Handlers.cs | 1 + .../Properties/AssemblyInfo.cs | 1 - Dapper.EntityFramework.nuspec | 4 +- Dapper.SqlBuilder/Properties/AssemblyInfo.cs | 4 +- DapperTests NET35/Properties/AssemblyInfo.cs | 4 +- DapperTests NET45/Properties/AssemblyInfo.cs | 4 +- Tests/Properties/AssemblyInfo.cs | 4 +- Tests/Tests.cs | 18 +++++--- dapper.nuspec | 3 +- 17 files changed, 93 insertions(+), 65 deletions(-) delete mode 100644 Dapper.EntityFramework NET40/Properties/AssemblyInfo.cs create mode 100644 Dapper.EntityFramework NET45/DbGeometryHandler.cs diff --git a/Dapper NET40/Properties/AssemblyInfo.cs b/Dapper NET40/Properties/AssemblyInfo.cs index c266cc1a..5e8e55e7 100644 --- a/Dapper NET40/Properties/AssemblyInfo.cs +++ b/Dapper NET40/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.32.0.0")] -[assembly: AssemblyFileVersion("1.32.0.0")] +[assembly: AssemblyVersion("1.33.0.0")] +[assembly: AssemblyFileVersion("1.33.0.0")] diff --git a/Dapper NET40/SqlMapper.cs b/Dapper NET40/SqlMapper.cs index 925c62d4..0a6a7a6f 100644 --- a/Dapper NET40/SqlMapper.cs +++ b/Dapper NET40/SqlMapper.cs @@ -839,11 +839,14 @@ namespace Dapper { return DbType.Object; } - if(type.FullName == "Microsoft.SqlServer.Types.SqlGeography") + switch (type.FullName) { - handler = new UdtTypeHandler("GEOGRAPHY"); - AddTypeHandler(type, handler); - return DbType.Object; + case "Microsoft.SqlServer.Types.SqlGeography": + AddTypeHandler(type, handler = new UdtTypeHandler("GEOGRAPHY")); + return DbType.Object; + case "Microsoft.SqlServer.Types.SqlGeometry": + AddTypeHandler(type, handler = new UdtTypeHandler("GEOMETRY")); + return DbType.Object; } throw new NotSupportedException(string.Format("The member {0} of type {1} cannot be used as a parameter value", name, type)); } diff --git a/Dapper.Contrib.Tests/Properties/AssemblyInfo.cs b/Dapper.Contrib.Tests/Properties/AssemblyInfo.cs index 869cf580..10613ac7 100644 --- a/Dapper.Contrib.Tests/Properties/AssemblyInfo.cs +++ b/Dapper.Contrib.Tests/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.32.0.0")] -[assembly: AssemblyFileVersion("1.32.0.0")] +[assembly: AssemblyVersion("1.33.0.0")] +[assembly: AssemblyFileVersion("1.33.0.0")] diff --git a/Dapper.Contrib/Properties/AssemblyInfo.cs b/Dapper.Contrib/Properties/AssemblyInfo.cs index c3bfc737..07083a77 100644 --- a/Dapper.Contrib/Properties/AssemblyInfo.cs +++ b/Dapper.Contrib/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.32.0.0")] -[assembly: AssemblyFileVersion("1.32.0.0")] +[assembly: AssemblyVersion("1.33.0.0")] +[assembly: AssemblyFileVersion("1.33.0.0")] diff --git a/Dapper.EntityFramework NET40/Dapper.EntityFramework NET40.csproj b/Dapper.EntityFramework NET40/Dapper.EntityFramework NET40.csproj index f9125c2c..97a04426 100644 --- a/Dapper.EntityFramework NET40/Dapper.EntityFramework NET40.csproj +++ b/Dapper.EntityFramework NET40/Dapper.EntityFramework NET40.csproj @@ -57,10 +57,15 @@ DbGeographyHandler.cs + + DbGeometryHandler.cs + Handlers.cs - + + AssemblyInfo.cs + @@ -92,6 +97,9 @@ Dapper NET40 + + +