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 | 13 +++--- .../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, 94 insertions(+), 66 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 c266cc1..5e8e55e 100644 --- a/Dapper NET40/Properties/AssemblyInfo.cs +++ b/Dapper NET40/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // // 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 925c62d..0a6a7a6 100644 --- a/Dapper NET40/SqlMapper.cs +++ b/Dapper NET40/SqlMapper.cs @@ -839,11 +839,14 @@ internal static DbType LookupDbType(Type type, string name, out ITypeHandler han { return DbType.Object; } - if(type.FullName == "Microsoft.SqlServer.Types.SqlGeography") - { - handler = new UdtTypeHandler("GEOGRAPHY"); - AddTypeHandler(type, handler); - return DbType.Object; + switch (type.FullName) + { + 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 869cf58..10613ac 100644 --- a/Dapper.Contrib.Tests/Properties/AssemblyInfo.cs +++ b/Dapper.Contrib.Tests/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // // 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 c3bfc73..07083a7 100644 --- a/Dapper.Contrib/Properties/AssemblyInfo.cs +++ b/Dapper.Contrib/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // // 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 f9125c2..97a0442 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 + + +