From 3a4c675654fc60fe31155b7bbc38e9a4934a35a3 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Sun, 8 Jul 2018 16:56:33 +0100 Subject: [PATCH 01/31] Remove old TeamCity config --- .../EntityFramework6Npgsql_Build.xml | 137 ------------------ .../pluginData/plugin-settings.xml | 5 - .../EntityFramework6Npgsql/project-config.xml | 10 -- .../EntityFramework6Npgsql_Github.xml | 19 --- 4 files changed, 171 deletions(-) delete mode 100644 .teamcity/EntityFramework6Npgsql/buildTypes/EntityFramework6Npgsql_Build.xml delete mode 100644 .teamcity/EntityFramework6Npgsql/pluginData/plugin-settings.xml delete mode 100644 .teamcity/EntityFramework6Npgsql/project-config.xml delete mode 100644 .teamcity/EntityFramework6Npgsql/vcsRoots/EntityFramework6Npgsql_Github.xml diff --git a/.teamcity/EntityFramework6Npgsql/buildTypes/EntityFramework6Npgsql_Build.xml b/.teamcity/EntityFramework6Npgsql/buildTypes/EntityFramework6Npgsql_Build.xml deleted file mode 100644 index 3ae11b0..0000000 --- a/.teamcity/EntityFramework6Npgsql/buildTypes/EntityFramework6Npgsql_Build.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - Build - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.teamcity/EntityFramework6Npgsql/pluginData/plugin-settings.xml b/.teamcity/EntityFramework6Npgsql/pluginData/plugin-settings.xml deleted file mode 100644 index 784b770..0000000 --- a/.teamcity/EntityFramework6Npgsql/pluginData/plugin-settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.teamcity/EntityFramework6Npgsql/project-config.xml b/.teamcity/EntityFramework6Npgsql/project-config.xml deleted file mode 100644 index 6c2ccfb..0000000 --- a/.teamcity/EntityFramework6Npgsql/project-config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - EntityFramework6.Npgsql - Entity Framework 6/5 for PostgreSQL - - - - - - diff --git a/.teamcity/EntityFramework6Npgsql/vcsRoots/EntityFramework6Npgsql_Github.xml b/.teamcity/EntityFramework6Npgsql/vcsRoots/EntityFramework6Npgsql_Github.xml deleted file mode 100644 index 7c55983..0000000 --- a/.teamcity/EntityFramework6Npgsql/vcsRoots/EntityFramework6Npgsql_Github.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - https://github.com/npgsql/EntityFramework6.Npgsql.git - - - - - - - - - - - - - - From 08e00f11d535a45d5279e0ff73b1526534df049f Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 9 Jul 2018 16:37:10 +1200 Subject: [PATCH 02/31] added documentation paragraph. --- doc/index.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/index.md b/doc/index.md index 0a73365..bf228b7 100644 --- a/doc/index.md +++ b/doc/index.md @@ -6,6 +6,21 @@ title: Entity Framework 6 Npgsql has an Entity Framework 6 provider. You can use it by installing the [EntityFramework6.Npgsql](https://www.nuget.org/packages/EntityFramework6.Npgsql/) nuget. +## Basic Usage ## +Create an inheritor if DbConfiguration in the same assembly as your entity framework DbContext. Ensure that you configure provider services, a provider factory, a default connection factory as shown below: + +``` +class NpgSqlConfiguration : DbConfiguration +{ + public NpgSqlConfiguration() + { + SetProviderFactory("Npgsql", NpgsqlFactory.Instance); + SetProviderServices("Npgsql", provider: NpgsqlServices.Instance); + SetDefaultConnectionFactory(new NpgsqlConnectionFactory()); + } +} +``` + ## Guid Support ## Npgsql EF migrations support uses `uuid_generate_v4()` function to generate guids. From a2a6ba979acf7f2944e3e591290eaf8a0d3912d1 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 9 Jul 2018 16:41:07 +1200 Subject: [PATCH 03/31] fixed spelling mistake --- doc/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/index.md b/doc/index.md index bf228b7..d2cee0b 100644 --- a/doc/index.md +++ b/doc/index.md @@ -7,7 +7,7 @@ Npgsql has an Entity Framework 6 provider. You can use it by installing the [EntityFramework6.Npgsql](https://www.nuget.org/packages/EntityFramework6.Npgsql/) nuget. ## Basic Usage ## -Create an inheritor if DbConfiguration in the same assembly as your entity framework DbContext. Ensure that you configure provider services, a provider factory, a default connection factory as shown below: +Create an inheritor of DbConfiguration in the same assembly as your entity framework DbContext. Ensure that you configure provider services, a provider factory, a default connection factory as shown below: ``` class NpgSqlConfiguration : DbConfiguration From 374c357e0f53649243e29eb908a52ed75b8f6f4b Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 10 Jul 2018 21:41:07 +1200 Subject: [PATCH 04/31] refactored based on review + renamed title. + rephrased sentence. + added csharp snippet styling. + added line snippets to classes. + included namespaces required. --- doc/index.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/index.md b/doc/index.md index d2cee0b..21a7e4e 100644 --- a/doc/index.md +++ b/doc/index.md @@ -6,10 +6,13 @@ title: Entity Framework 6 Npgsql has an Entity Framework 6 provider. You can use it by installing the [EntityFramework6.Npgsql](https://www.nuget.org/packages/EntityFramework6.Npgsql/) nuget. -## Basic Usage ## -Create an inheritor of DbConfiguration in the same assembly as your entity framework DbContext. Ensure that you configure provider services, a provider factory, a default connection factory as shown below: +## Basic Configuration ## +To use Entity Framework with Npgsql, define a class that inherits from `DbConfiguration` in the same assembly as your class inheriting `DbContext`. Ensure that you configure provider services, a provider factory, a default connection factory as shown below: + +```csharp +using Npgsql; +using System.Data.Entity; -``` class NpgSqlConfiguration : DbConfiguration { public NpgSqlConfiguration() From b00d1533e64d5045a7e0875925f4f3cffe6ed10e Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 10 Jul 2018 21:49:10 +1200 Subject: [PATCH 05/31] added named parameters --- doc/index.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/index.md b/doc/index.md index 21a7e4e..1dd3137 100644 --- a/doc/index.md +++ b/doc/index.md @@ -17,9 +17,15 @@ class NpgSqlConfiguration : DbConfiguration { public NpgSqlConfiguration() { - SetProviderFactory("Npgsql", NpgsqlFactory.Instance); - SetProviderServices("Npgsql", provider: NpgsqlServices.Instance); - SetDefaultConnectionFactory(new NpgsqlConnectionFactory()); + var name = "Npgsql"; + + SetProviderFactory(providerInvariantName: name, + providerFactory: NpgsqlFactory.Instance); + + SetProviderServices(providerInvariantName: name, + provider: NpgsqlServices.Instance); + + SetDefaultConnectionFactory(connectionFactory: new NpgsqlConnectionFactory()); } } ``` From 428fb5dd22b00d767d361113b5bda8e5c2aeb669 Mon Sep 17 00:00:00 2001 From: rwasef1830 Date: Tue, 16 Apr 2019 21:10:51 +0200 Subject: [PATCH 06/31] Convert enum values to workaround Npgsql > 4.0 strict type checking. Fixes https://github.com/npgsql/EntityFramework6.Npgsql/issues/105 --- src/EntityFramework6.Npgsql/NpgsqlServices.cs | 21 ++++++ .../EntityFrameworkBasicTests.cs | 65 +++++++++++++++++++ .../Support/EntityFrameworkTestBase.cs | 53 +++++++++++++++ 3 files changed, 139 insertions(+) diff --git a/src/EntityFramework6.Npgsql/NpgsqlServices.cs b/src/EntityFramework6.Npgsql/NpgsqlServices.cs index a7f1abd..70db12f 100644 --- a/src/EntityFramework6.Npgsql/NpgsqlServices.cs +++ b/src/EntityFramework6.Npgsql/NpgsqlServices.cs @@ -32,6 +32,7 @@ using Npgsql.SqlGenerators; using DbConnection = System.Data.Common.DbConnection; using DbCommand = System.Data.Common.DbCommand; +using System.Data.Common; #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member @@ -73,6 +74,26 @@ internal DbCommand CreateDbCommand(Version serverVersion, DbCommandTree commandT return command; } + protected override void SetDbParameterValue(DbParameter parameter, TypeUsage parameterType, object value) + { + base.SetDbParameterValue(parameter, parameterType, value); + ConvertValueToNumericIfEnum(parameter); + } + + // Npgsql > 4.0 does strict type checks on integral values and fails with enums passed with numeric DbType. + static void ConvertValueToNumericIfEnum(DbParameter parameter) + { + var parameterValueObjectType = parameter.Value.GetType(); + + if (!parameterValueObjectType.IsEnum) + { + return; + } + + var underlyingType = Enum.GetUnderlyingType(parameterValueObjectType); + parameter.Value = Convert.ChangeType(parameter.Value, underlyingType); + } + internal void TranslateCommandTree(Version serverVersion, DbCommandTree commandTree, DbCommand command, bool createParametersForNonSelect = true) { SqlBaseGenerator sqlGenerator; diff --git a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs b/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs index cc7d85f..2dc1ff4 100644 --- a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs +++ b/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs @@ -847,5 +847,70 @@ public void Test_string_multiple_null_propagation() query.ToString()); } } + + [Test] + public void Test_enum() + { + using (var context = new BloggingContext(ConnectionString)) + { + context.Database.Log = Console.Out.WriteLine; + + context.ClrEnumEntities.Add( + new ClrEnumEntity + { + TestByte = TestByteEnum.Bar, + TestShort = TestShortEnum.Bar, + TestInt = TestIntEnum.Bar, + TestLong = TestLongEnum.Bar + }); + context.SaveChanges(); + + var query = context.ClrEnumEntities.Where( + x => x.TestByte == TestByteEnum.Bar + && x.TestShort == TestShortEnum.Bar + && x.TestInt == TestIntEnum.Bar + && x.TestLong == TestLongEnum.Bar); + + var result = query.First(); + Assert.That(result.TestByte, Is.EqualTo(TestByteEnum.Bar)); + Assert.That(result.TestShort, Is.EqualTo(TestShortEnum.Bar)); + Assert.That(result.TestInt, Is.EqualTo(TestIntEnum.Bar)); + Assert.That(result.TestLong, Is.EqualTo(TestLongEnum.Bar)); + } + } + + [Test] + public void Test_enum_composite_key() + { + using (var context = new BloggingContext(ConnectionString)) + { + context.Database.Log = Console.Out.WriteLine; + + context.ClrEnumCompositeKeyEntities.Add( + new ClrEnumCompositeKeyEntity + { + TestByte = TestByteEnum.Bar, + TestShort = TestShortEnum.Bar, + TestInt = TestIntEnum.Bar, + TestLong = TestLongEnum.Bar + }); + context.SaveChanges(); + } + + using (var context = new BloggingContext(ConnectionString)) + { + var result = context.ClrEnumCompositeKeyEntities.Find( + TestByteEnum.Bar, + TestShortEnum.Bar, + TestIntEnum.Bar, + TestLongEnum.Bar); + + Assert.That(result, Is.Not.Null); + Assert.That(result.TestByte, Is.EqualTo(TestByteEnum.Bar)); + Assert.That(result.TestShort, Is.EqualTo(TestShortEnum.Bar)); + Assert.That(result.TestInt, Is.EqualTo(TestIntEnum.Bar)); + Assert.That(result.TestLong, Is.EqualTo(TestLongEnum.Bar)); + } + } } } diff --git a/test/EntityFramework6.Npgsql.Tests/Support/EntityFrameworkTestBase.cs b/test/EntityFramework6.Npgsql.Tests/Support/EntityFrameworkTestBase.cs index d00f6ca..e7e980b 100644 --- a/test/EntityFramework6.Npgsql.Tests/Support/EntityFrameworkTestBase.cs +++ b/test/EntityFramework6.Npgsql.Tests/Support/EntityFrameworkTestBase.cs @@ -25,6 +25,7 @@ using NUnit.Framework; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Data.Common; using System.Data.Entity; using System.Linq; @@ -102,6 +103,54 @@ public class Post public virtual Blog Blog { get; set; } } + public class ClrEnumEntity + { + public int Id { get; set; } + public TestByteEnum TestByte { get; set; } + public TestShortEnum TestShort { get; set; } + public TestIntEnum TestInt { get; set; } + public TestLongEnum TestLong { get; set; } + } + + public class ClrEnumCompositeKeyEntity + { + [Key, Column(Order = 1)] + public TestByteEnum TestByte { get; set; } + + [Key, Column(Order = 2)] + public TestShortEnum TestShort { get; set; } + + [Key, Column(Order = 3)] + public TestIntEnum TestInt { get; set; } + + [Key, Column(Order = 4)] + public TestLongEnum TestLong { get; set; } + } + + public enum TestByteEnum : byte + { + Foo = 0, + Bar = 1 + } + + public enum TestShortEnum : short + { + Foo = 0, + Bar = 1 + } + + public enum TestIntEnum + { + Foo = 0, + Bar = 1 + } + + public enum TestLongEnum : long + { + Foo = 0, + Bar = 1 + } + public class NoColumnsEntity { public int Id { get; set; } @@ -131,6 +180,8 @@ public BloggingContext(string connection) public DbSet Blogs { get; set; } public DbSet Posts { get; set; } public DbSet NoColumnsEntities { get; set; } + public DbSet ClrEnumEntities { get; set; } + public DbSet ClrEnumCompositeKeyEntities { get; set; } public DbSet Users { get; set; } public DbSet Editors { get; set; } public DbSet Administrators { get; set; } @@ -164,6 +215,8 @@ private static DbCompiledModel CreateModel(NpgsqlConnection connection) dbModelBuilder.Entity(); dbModelBuilder.Entity(); dbModelBuilder.Entity(); + dbModelBuilder.Entity(); + dbModelBuilder.Entity(); dbModelBuilder.Entity(); dbModelBuilder.Entity(); dbModelBuilder.Entity(); From f58b06857997636734464f2599995983902b297f Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 20 May 2019 14:57:38 +0200 Subject: [PATCH 07/31] Update copyright to 2019 --- src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj b/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj index b0bb8ff..72a972e 100644 --- a/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj +++ b/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj @@ -2,7 +2,7 @@ PostgreSQL provider for Entity Framework 6 Shay Rojansky;Emil Lenngren;Francisco Figueiredo Jr.;Kenji Uno - Copyright 2018 © The Npgsql Development Team + Copyright 2019 © The Npgsql Development Team Npgsql npgsql postgresql postgres data database entity framework ef orm 3.2.0 From 0a804a8e0d81308242f424892c474e9618db8c85 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 20 May 2019 15:00:31 +0200 Subject: [PATCH 08/31] Depend on .NET Framework targeting pack nugets Depend on .NET Framework reference assemblies via the new nuget packages. This allows us to build .NET Framework on systems where .NET Framework isn't installed (e.g. Linux). --- Directory.Build.props | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..f1d9f98 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,9 @@ + + + + + + + + From 17ed69a6d364187f0172cbe47a89325a5728413c Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 20 May 2019 15:06:09 +0200 Subject: [PATCH 09/31] Remove license header from source files --- .../NpgsqlConnectionFactory.cs | 25 +-------------- .../NpgsqlMigrationSqlGenerator.cs | 27 ++-------------- .../NpgsqlProviderManifest.cs | 25 +-------------- src/EntityFramework6.Npgsql/NpgsqlServices.cs | 25 +-------------- .../SqlGenerators/PendingProjectsNode.cs | 25 +-------------- .../SqlGenerators/SqlBaseGenerator.cs | 25 +-------------- .../SqlGenerators/SqlDeleteGenerator.cs | 25 +-------------- .../SqlGenerators/SqlInsertGenerator.cs | 25 +-------------- .../SqlGenerators/SqlSelectGenerator.cs | 25 +-------------- .../SqlGenerators/SqlUpdateGenerator.cs | 25 +-------------- .../SqlGenerators/StringPair.cs | 25 +-------------- .../SqlGenerators/VisitedExpression.cs | 25 +-------------- .../EntityFrameworkBasicTests.cs | 27 ++-------------- .../EntityFrameworkMigrationTests.cs | 27 ++-------------- .../FullTextSearchTests.cs | 25 +-------------- .../NLogLoggingProvider.cs | 25 +-------------- .../PatternMatchingTests.cs | 25 +-------------- .../Support/EntityFrameworkTestBase.cs | 31 +++---------------- .../Support/TestBase.cs | 25 +-------------- .../Support/TestUtil.cs | 25 +-------------- 20 files changed, 26 insertions(+), 486 deletions(-) diff --git a/src/EntityFramework6.Npgsql/NpgsqlConnectionFactory.cs b/src/EntityFramework6.Npgsql/NpgsqlConnectionFactory.cs index 926d39c..1d5e499 100644 --- a/src/EntityFramework6.Npgsql/NpgsqlConnectionFactory.cs +++ b/src/EntityFramework6.Npgsql/NpgsqlConnectionFactory.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System.Data.Common; +using System.Data.Common; using System.Data.Entity.Infrastructure; namespace Npgsql diff --git a/src/EntityFramework6.Npgsql/NpgsqlMigrationSqlGenerator.cs b/src/EntityFramework6.Npgsql/NpgsqlMigrationSqlGenerator.cs index cf8f413..c3f26e0 100644 --- a/src/EntityFramework6.Npgsql/NpgsqlMigrationSqlGenerator.cs +++ b/src/EntityFramework6.Npgsql/NpgsqlMigrationSqlGenerator.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Collections.Generic; using System.Data.Entity.Migrations.Model; using System.Data.Entity.Migrations.Sql; @@ -436,7 +413,7 @@ protected virtual void Convert(RenameIndexOperation renameIndexOperation) string GetSchemaNameFromFullTableName(string tableFullName) { var dotIndex = tableFullName.IndexOf('.'); - return dotIndex != -1 ? tableFullName.Remove(dotIndex) : "dto"; + return dotIndex != -1 ? tableFullName.Remove(dotIndex) : "dto"; //TODO: Check always setting dto schema if no schema in table name is not bug } diff --git a/src/EntityFramework6.Npgsql/NpgsqlProviderManifest.cs b/src/EntityFramework6.Npgsql/NpgsqlProviderManifest.cs index a6d4350..a76542a 100644 --- a/src/EntityFramework6.Npgsql/NpgsqlProviderManifest.cs +++ b/src/EntityFramework6.Npgsql/NpgsqlProviderManifest.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Collections.Generic; using System.Data.Entity; using System.Data.Entity.Core.Common; diff --git a/src/EntityFramework6.Npgsql/NpgsqlServices.cs b/src/EntityFramework6.Npgsql/NpgsqlServices.cs index 70db12f..0a0351d 100644 --- a/src/EntityFramework6.Npgsql/NpgsqlServices.cs +++ b/src/EntityFramework6.Npgsql/NpgsqlServices.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Text; using JetBrains.Annotations; using System.Data.Entity.Core.Common; diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/PendingProjectsNode.cs b/src/EntityFramework6.Npgsql/SqlGenerators/PendingProjectsNode.cs index 646fba6..346a1e6 100644 --- a/src/EntityFramework6.Npgsql/SqlGenerators/PendingProjectsNode.cs +++ b/src/EntityFramework6.Npgsql/SqlGenerators/PendingProjectsNode.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System.Collections.Generic; +using System.Collections.Generic; namespace Npgsql.SqlGenerators { diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/SqlBaseGenerator.cs b/src/EntityFramework6.Npgsql/SqlGenerators/SqlBaseGenerator.cs index c2247fc..b36413a 100644 --- a/src/EntityFramework6.Npgsql/SqlGenerators/SqlBaseGenerator.cs +++ b/src/EntityFramework6.Npgsql/SqlGenerators/SqlBaseGenerator.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Collections.Generic; using System.Data.Common; using System.Diagnostics; diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/SqlDeleteGenerator.cs b/src/EntityFramework6.Npgsql/SqlGenerators/SqlDeleteGenerator.cs index 0766ac0..a24eb92 100644 --- a/src/EntityFramework6.Npgsql/SqlGenerators/SqlDeleteGenerator.cs +++ b/src/EntityFramework6.Npgsql/SqlGenerators/SqlDeleteGenerator.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Data.Common; using System.Data.Entity.Core.Common.CommandTrees; diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/SqlInsertGenerator.cs b/src/EntityFramework6.Npgsql/SqlGenerators/SqlInsertGenerator.cs index 0e0fe5a..856a31a 100644 --- a/src/EntityFramework6.Npgsql/SqlGenerators/SqlInsertGenerator.cs +++ b/src/EntityFramework6.Npgsql/SqlGenerators/SqlInsertGenerator.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Collections.Generic; using System.Data.Common; using System.Data.Entity.Core.Common.CommandTrees; diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/SqlSelectGenerator.cs b/src/EntityFramework6.Npgsql/SqlGenerators/SqlSelectGenerator.cs index 22d22e6..ed2616a 100644 --- a/src/EntityFramework6.Npgsql/SqlGenerators/SqlSelectGenerator.cs +++ b/src/EntityFramework6.Npgsql/SqlGenerators/SqlSelectGenerator.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Linq; using System.Data.Common; using System.Diagnostics; diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/SqlUpdateGenerator.cs b/src/EntityFramework6.Npgsql/SqlGenerators/SqlUpdateGenerator.cs index fde7c7a..acf3fb3 100644 --- a/src/EntityFramework6.Npgsql/SqlGenerators/SqlUpdateGenerator.cs +++ b/src/EntityFramework6.Npgsql/SqlGenerators/SqlUpdateGenerator.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Data.Common; using System.Data.Entity.Core.Common.CommandTrees; diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/StringPair.cs b/src/EntityFramework6.Npgsql/SqlGenerators/StringPair.cs index c605574..72d2512 100644 --- a/src/EntityFramework6.Npgsql/SqlGenerators/StringPair.cs +++ b/src/EntityFramework6.Npgsql/SqlGenerators/StringPair.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/VisitedExpression.cs b/src/EntityFramework6.Npgsql/SqlGenerators/VisitedExpression.cs index 2621c74..b952deb 100644 --- a/src/EntityFramework6.Npgsql/SqlGenerators/VisitedExpression.cs +++ b/src/EntityFramework6.Npgsql/SqlGenerators/VisitedExpression.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs b/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs index 2dc1ff4..4e89635 100644 --- a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs +++ b/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using Npgsql; +using Npgsql; using NUnit.Framework; using System; using System.Collections.Generic; @@ -898,7 +875,7 @@ public void Test_enum_composite_key() } using (var context = new BloggingContext(ConnectionString)) - { + { var result = context.ClrEnumCompositeKeyEntities.Find( TestByteEnum.Bar, TestShortEnum.Bar, diff --git a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkMigrationTests.cs b/test/EntityFramework6.Npgsql.Tests/EntityFrameworkMigrationTests.cs index dccc6fd..3fde9fb 100644 --- a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkMigrationTests.cs +++ b/test/EntityFramework6.Npgsql.Tests/EntityFrameworkMigrationTests.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using Npgsql; +using Npgsql; using NUnit.Framework; using System; using System.Collections.Generic; @@ -491,7 +468,7 @@ public void RenameIndexOperation() } else { - Assert.AreEqual("ALTER INDEX someSchema.\"someOldIndexName\" RENAME TO \"someNewIndexName\"", statements.ElementAt(0).Sql); + Assert.AreEqual("ALTER INDEX someSchema.\"someOldIndexName\" RENAME TO \"someNewIndexName\"", statements.ElementAt(0).Sql); } } diff --git a/test/EntityFramework6.Npgsql.Tests/FullTextSearchTests.cs b/test/EntityFramework6.Npgsql.Tests/FullTextSearchTests.cs index 101e8b3..6d81f43 100644 --- a/test/EntityFramework6.Npgsql.Tests/FullTextSearchTests.cs +++ b/test/EntityFramework6.Npgsql.Tests/FullTextSearchTests.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using Npgsql; +using Npgsql; using NUnit.Framework; using System; using System.Collections.Generic; diff --git a/test/EntityFramework6.Npgsql.Tests/NLogLoggingProvider.cs b/test/EntityFramework6.Npgsql.Tests/NLogLoggingProvider.cs index e8940e9..509a7f3 100644 --- a/test/EntityFramework6.Npgsql.Tests/NLogLoggingProvider.cs +++ b/test/EntityFramework6.Npgsql.Tests/NLogLoggingProvider.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using NLog; using Npgsql.Logging; diff --git a/test/EntityFramework6.Npgsql.Tests/PatternMatchingTests.cs b/test/EntityFramework6.Npgsql.Tests/PatternMatchingTests.cs index 6260b90..6f83d75 100644 --- a/test/EntityFramework6.Npgsql.Tests/PatternMatchingTests.cs +++ b/test/EntityFramework6.Npgsql.Tests/PatternMatchingTests.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using Npgsql; +using Npgsql; using NUnit.Framework; using System; using System.Collections.Generic; diff --git a/test/EntityFramework6.Npgsql.Tests/Support/EntityFrameworkTestBase.cs b/test/EntityFramework6.Npgsql.Tests/Support/EntityFrameworkTestBase.cs index e7e980b..d07af64 100644 --- a/test/EntityFramework6.Npgsql.Tests/Support/EntityFrameworkTestBase.cs +++ b/test/EntityFramework6.Npgsql.Tests/Support/EntityFrameworkTestBase.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using Npgsql; +using Npgsql; using NUnit.Framework; using System; using System.Collections.Generic; @@ -202,7 +179,7 @@ public static int StoredEchoFunction(int value) public IQueryable GetBlogsByName(string name) { ObjectParameter nameParameter = new ObjectParameter("Name", name); - + return ((IObjectContextAdapter)this).ObjectContext.CreateQuery( $"[GetBlogsByName](@Name)", nameParameter); } @@ -337,7 +314,7 @@ private static DbCompiledModel CreateModel(NpgsqlConnection connection) { IsFunctionImport = true, IsComposable = true, - Parameters = new[] + Parameters = new[] { FunctionParameter.Create("Name", stringPrimitiveType, ParameterMode.In) }, @@ -345,7 +322,7 @@ private static DbCompiledModel CreateModel(NpgsqlConnection connection) { FunctionParameter.Create("ReturnType1", modelBlogConceptualType.GetCollectionType(), ParameterMode.ReturnValue) }, - EntitySets = new[] + EntitySets = new[] { dbModel.ConceptualModel.Container.EntitySets.First(x => x.ElementType == modelBlogConceptualType) } diff --git a/test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs b/test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs index d11f508..0ccad6d 100644 --- a/test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs +++ b/test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using NLog.Config; using NLog.Targets; using NLog; diff --git a/test/EntityFramework6.Npgsql.Tests/Support/TestUtil.cs b/test/EntityFramework6.Npgsql.Tests/Support/TestUtil.cs index b34eeab..5b46519 100644 --- a/test/EntityFramework6.Npgsql.Tests/Support/TestUtil.cs +++ b/test/EntityFramework6.Npgsql.Tests/Support/TestUtil.cs @@ -1,27 +1,4 @@ -#region License -// The PostgreSQL License -// -// Copyright (C) 2016 The Npgsql Development Team -// -// Permission to use, copy, modify, and distribute this software and its -// documentation for any purpose, without fee, and without a written -// agreement is hereby granted, provided that the above copyright notice -// and this paragraph and the following two paragraphs appear in all copies. -// -// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY -// FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -// INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -// DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// -// THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -// ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS -// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -#endregion - -using System; +using System; using System.Threading; using System.Threading.Tasks; using JetBrains.Annotations; From b0e726420c766021bd95a53a5197683c21bbf776 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 20 May 2019 16:37:28 +0200 Subject: [PATCH 10/31] Add .idea to .gitignore --- .gitignore | 1 + EntityFramework6.Npgsql.sln.DotSettings | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index adc05e9..f10af03 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.sln.docstates *.userprefs /*.nupkg +.idea/ .nuget/ [Bb]in/ [Bb]uild/ diff --git a/EntityFramework6.Npgsql.sln.DotSettings b/EntityFramework6.Npgsql.sln.DotSettings index 78c61b1..5dfab15 100644 --- a/EntityFramework6.Npgsql.sln.DotSettings +++ b/EntityFramework6.Npgsql.sln.DotSettings @@ -58,6 +58,7 @@ True True True + True True True True From 76215722c6b4fc476f27cac596e4452a49949169 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 20 May 2019 15:17:37 +0200 Subject: [PATCH 11/31] Depend on Npgsql 4.0.7 --- src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj | 2 +- test/EntityFramework6.Npgsql.Tests/App.config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj b/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj index 72a972e..e580ee0 100644 --- a/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj +++ b/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj @@ -39,7 +39,7 @@ - + diff --git a/test/EntityFramework6.Npgsql.Tests/App.config b/test/EntityFramework6.Npgsql.Tests/App.config index 931aca8..3bd6d0b 100644 --- a/test/EntityFramework6.Npgsql.Tests/App.config +++ b/test/EntityFramework6.Npgsql.Tests/App.config @@ -29,7 +29,7 @@ - + From ce97536e81efff78ed71992024a9039195c35beb Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 20 May 2019 15:21:47 +0200 Subject: [PATCH 12/31] Update test dependencies --- .../EntityFramework6.Npgsql.Tests.csproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj b/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj index de91a6a..12e4322 100644 --- a/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj +++ b/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj @@ -7,10 +7,10 @@ - - - - - + + + + + From 90417e143ef46c6960db147fe6f5c015f994b9b4 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Tue, 21 May 2019 09:21:40 +0200 Subject: [PATCH 13/31] Switch to PackageLicenseExpression in nuget --- src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj b/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj index e580ee0..260303c 100644 --- a/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj +++ b/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj @@ -18,7 +18,7 @@ true http://www.npgsql.org http://www.npgsql.org/img/postgresql.gif - https://raw.githubusercontent.com/npgsql/npgsql/master/LICENSE.txt + PostgreSQL git git://github.com/npgsql/EntityFramework6.Npgsql true From 02b5793327b6275f7c9544efd30c5d17704ae5d9 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 20 May 2019 15:12:26 +0200 Subject: [PATCH 14/31] Target .NET Standard 2.1, update version * Version is now 3.3.0 * Take dependency on EntityFramework 6.3.0-preview5-19254-05 * All tests pass * Remove unneeded implicit assembly references for net45 Closes #119 --- Directory.Build.props | 4 +++ .../EntityFramework6.Npgsql.csproj | 8 ++--- .../EntityFramework6.Npgsql.Tests.csproj | 3 +- .../EntityFrameworkBasicTests.cs | 8 ++--- .../Support/AssemblySetup.cs | 30 +++++++++++++++++++ .../Support/TestBase.cs | 21 ------------- .../Support/TestDbConfiguration.cs | 15 ++++++++++ 7 files changed, 59 insertions(+), 30 deletions(-) create mode 100644 test/EntityFramework6.Npgsql.Tests/Support/AssemblySetup.cs create mode 100644 test/EntityFramework6.Npgsql.Tests/Support/TestDbConfiguration.cs diff --git a/Directory.Build.props b/Directory.Build.props index f1d9f98..d53ede3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,9 @@  + + true + + diff --git a/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj b/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj index 260303c..471878e 100644 --- a/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj +++ b/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj @@ -5,9 +5,9 @@ Copyright 2019 © The Npgsql Development Team Npgsql npgsql postgresql postgres data database entity framework ef orm - 3.2.0 + 6.3.0 latest - net45 + net45;netstandard21 true CS1591 true @@ -29,7 +29,7 @@ - + @@ -40,6 +40,6 @@ - + diff --git a/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj b/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj index 12e4322..5c8d4cf 100644 --- a/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj +++ b/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj @@ -1,12 +1,13 @@  latest - net45 + net45;netcoreapp3.0 + diff --git a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs b/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs index 4e89635..180fb08 100644 --- a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs +++ b/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs @@ -17,7 +17,7 @@ namespace EntityFramework6.Npgsql.Tests { public class EntityFrameworkBasicTests : EntityFrameworkTestBase { - [Test] + [Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/860")] public void InsertAndSelect() { var varbitVal = "10011"; @@ -457,7 +457,7 @@ public void DateFunctions() //Hunting season is open Happy hunting on OrderBy,GroupBy,Min,Max,Skip,Take,ThenBy... and all posible combinations - [Test] + [Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/861")] public void TestComplicatedQueries() { using (var context = new BloggingContext(ConnectionString)) @@ -517,7 +517,7 @@ public void TestComplicatedQueries() } } - [Test] + [Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/861")] [MonoIgnore("Probably bug in mono. See https://github.com/npgsql/Npgsql/issues/289.")] public void TestComplicatedQueriesMonoFails() { @@ -541,7 +541,7 @@ public void TestComplicatedQueriesMonoFails() } } - [Test] + [Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/861")] public void TestComplicatedQueriesWithApply() { using (var conn = OpenConnection(ConnectionString)) diff --git a/test/EntityFramework6.Npgsql.Tests/Support/AssemblySetup.cs b/test/EntityFramework6.Npgsql.Tests/Support/AssemblySetup.cs new file mode 100644 index 0000000..e503497 --- /dev/null +++ b/test/EntityFramework6.Npgsql.Tests/Support/AssemblySetup.cs @@ -0,0 +1,30 @@ +using System.Data.Entity; +using NLog.Config; +using NLog.Targets; +using NUnit.Framework; +using Npgsql.Logging; +using EntityFramework6.Npgsql.Tests; +using EntityFramework6.Npgsql.Tests.Support; + +// ReSharper disable CheckNamespace + +[SetUpFixture] +public class AssemblySetup +{ + [OneTimeSetUp] + public void RegisterDbProvider() + { + var config = new LoggingConfiguration(); + var consoleTarget = new ConsoleTarget(); + consoleTarget.Layout = @"${message} ${exception:format=tostring}"; + config.AddTarget("console", consoleTarget); + var rule = new LoggingRule("*", NLog.LogLevel.Info, consoleTarget); + config.LoggingRules.Add(rule); + NLog.LogManager.Configuration = config; + + NpgsqlLogManager.Provider = new NLogLoggingProvider(); + NpgsqlLogManager.IsParameterLoggingEnabled = true; + + DbConfiguration.SetConfiguration(new TestDbConfiguration()); + } +} diff --git a/test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs b/test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs index 0ccad6d..cf23265 100644 --- a/test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs +++ b/test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs @@ -23,8 +23,6 @@ public abstract class TestBase string _connectionString; - static bool _loggingSetUp; - /// /// Unless the NPGSQL_TEST_DB environment variable is defined, this is used as the connection string for the /// test database. @@ -36,28 +34,9 @@ public abstract class TestBase [OneTimeSetUp] public virtual void TestFixtureSetup() { - SetupLogging(); _log.Debug("Connection string is: " + ConnectionString); } - protected virtual void SetupLogging() - { - var config = new LoggingConfiguration(); - var consoleTarget = new ConsoleTarget(); - consoleTarget.Layout = @"${message} ${exception:format=tostring}"; - config.AddTarget("console", consoleTarget); - var rule = new LoggingRule("*", NLog.LogLevel.Debug, consoleTarget); - config.LoggingRules.Add(rule); - NLog.LogManager.Configuration = config; - - if (!_loggingSetUp) - { - NpgsqlLogManager.Provider = new NLogLoggingProvider(); - NpgsqlLogManager.IsParameterLoggingEnabled = true; - _loggingSetUp = true; - } - } - #endregion #region Utilities for use by tests diff --git a/test/EntityFramework6.Npgsql.Tests/Support/TestDbConfiguration.cs b/test/EntityFramework6.Npgsql.Tests/Support/TestDbConfiguration.cs new file mode 100644 index 0000000..2276bed --- /dev/null +++ b/test/EntityFramework6.Npgsql.Tests/Support/TestDbConfiguration.cs @@ -0,0 +1,15 @@ +using System; +using System.Data.Entity; +using Npgsql; + +namespace EntityFramework6.Npgsql.Tests.Support +{ + public class TestDbConfiguration : DbConfiguration + { + public TestDbConfiguration() + { + SetProviderFactory("Npgsql", NpgsqlFactory.Instance); + SetProviderServices("Npgsql", NpgsqlServices.Instance); + } + } +} From 8180248c62fec3214727f4d9bc9d0a4b638edfbe Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 26 Sep 2019 15:50:45 +0200 Subject: [PATCH 15/31] Remove conceptual docs See https://github.com/npgsql/doc/issues/10 --- doc/index.md | 116 --------------------------------------------------- doc/toc.md | 1 - 2 files changed, 117 deletions(-) delete mode 100644 doc/index.md delete mode 100644 doc/toc.md diff --git a/doc/index.md b/doc/index.md deleted file mode 100644 index 1dd3137..0000000 --- a/doc/index.md +++ /dev/null @@ -1,116 +0,0 @@ ---- -layout: doc -title: Entity Framework 6 ---- - -Npgsql has an Entity Framework 6 provider. You can use it by installing the -[EntityFramework6.Npgsql](https://www.nuget.org/packages/EntityFramework6.Npgsql/) nuget. - -## Basic Configuration ## -To use Entity Framework with Npgsql, define a class that inherits from `DbConfiguration` in the same assembly as your class inheriting `DbContext`. Ensure that you configure provider services, a provider factory, a default connection factory as shown below: - -```csharp -using Npgsql; -using System.Data.Entity; - -class NpgSqlConfiguration : DbConfiguration -{ - public NpgSqlConfiguration() - { - var name = "Npgsql"; - - SetProviderFactory(providerInvariantName: name, - providerFactory: NpgsqlFactory.Instance); - - SetProviderServices(providerInvariantName: name, - provider: NpgsqlServices.Instance); - - SetDefaultConnectionFactory(connectionFactory: new NpgsqlConnectionFactory()); - } -} -``` - -## Guid Support ## - -Npgsql EF migrations support uses `uuid_generate_v4()` function to generate guids. -In order to have access to this function, you have to install the extension uuid-ossp through the following command: - -```sql -create extension "uuid-ossp"; -``` - -If you don't have this extension installed, when you run Npgsql migrations you will get the following error message: - -``` -ERROR: function uuid_generate_v4() does not exist -``` - -If the database is being created by Npgsql Migrations, you will need to -[run the `create extension` command in the `template1` database](http://stackoverflow.com/a/11584751). -This way, when the new database is created, the extension will be installed already. - -## Template Database ## - -When the Entity Framework 6 provider creates a database, it issues a simple `CREATE DATABASE` command. -In PostgreSQL, this implicitly uses `template1` as the template - anything existing in `template1` will -be copied to your new database. If you wish to change the database used as a template, you can specify -the `EF Template Database` connection string parameter. For more info see the -[PostgreSQL docs](https://www.postgresql.org/docs/current/static/sql-createdatabase.html). - -## Customizing DataReader Behavior ## - -You can use [an Entity Framework 6 IDbCommandInterceptor](https://msdn.microsoft.com/en-us/library/dn469464(v=vs.113).aspx) to wrap the `DataReader` instance returned by Npgsql when Entity Framework executes queries. This is possible using a ```DbConfiguration``` class. - -Example use cases: -- Forcing all returned ```DateTime``` and ```DateTimeOffset``` values to be in the UTC timezone. -- Preventing accidental insertion of DateTime values having ```DateTimeKind.Unspecified```. -- Forcing all postgres date/time types to be returned to Entity Framework as ```DateTimeOffset```. - -```c# -[DbConfigurationType(typeof(AppDbContextConfiguration))] -public class AppDbContext : DbContext -{ - // ... -} - -public class AppDbContextConfiguration : DbConfiguration -{ - public AppDbContextConfiguration() - { - this.AddInterceptor(new MyEntityFrameworkInterceptor()); - } -} - -class MyEntityFrameworkInterceptor : DbCommandInterceptor -{ - public override void ReaderExecuted( - DbCommand command, - DbCommandInterceptionContext interceptionContext) - { - if (interceptionContext.Result == null) return; - interceptionContext.Result = new WrappingDbDataReader(interceptionContext.Result); - } - - public override void ScalarExecuted( - DbCommand command, - DbCommandInterceptionContext interceptionContext) - { - interceptionContext.Result = ModifyReturnValues(interceptionContext.Result); - } - - static object ModifyReturnValues(object result) - { - // Transform and then - return result; - } -} - -class WrappingDbDataReader : DbDataReader, IDataReader -{ - // Wrap an existing DbDataReader, proxy all calls to the underlying instance, - // modify return values and/or parameters as needed... - public WrappingDbDataReader(DbDataReader reader) - { - } -} -``` diff --git a/doc/toc.md b/doc/toc.md deleted file mode 100644 index 0d45642..0000000 --- a/doc/toc.md +++ /dev/null @@ -1 +0,0 @@ -# [Getting Started](index.md) From d3023711263b6ba7b9df405985c3e06062ff7ed7 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 10 Oct 2019 04:26:59 +0200 Subject: [PATCH 16/31] Update to version 6.3.0 * Take dependency on EF6 6.3.0 GA * Take dependency on Npgsql 4.0.10. Also tested successfully with 4.1.1, but not taking dependency in order to preserve compatibility with .NET Framework 4.5. * Package snupkg * Nuget icon * Use transforms instead of Add-EFProvider (in install.ps1). See https://github.com/aspnet/EntityFramework6/pull/953 * Various build cleanups, project renames, etc. Closes #137 --- Directory.Build.props | 5 +++-- Directory.Build.targets | 12 +++++++++++ .../App.config | 2 +- EF6.PG.Tests/EF6.PG.Tests.csproj | 19 ++++++++++++++++++ .../EntityFrameworkBasicTests.cs | 8 ++++---- .../EntityFrameworkMigrationTests.cs | 0 .../FullTextSearchTests.cs | 0 .../NLogLoggingProvider.cs | 0 .../PatternMatchingTests.cs | 0 .../Spatial/PostgisServiceTests.cs | 0 .../Support/AssemblySetup.cs | 0 .../Support/CodeAnnotations.cs | 0 .../Support/EntityFrameworkTestBase.cs | 0 .../Support/TestBase.cs | 0 .../Support/TestDbConfiguration.cs | 0 .../Support/TestUtil.cs | 0 .../xmlModel/XmlTest.ObjectLayer.EF6.cs | 0 .../xmlModel/XmlTest.ObjectLayer.cs | 0 .../xmlModel/XmlTest.csdl | 0 .../xmlModel/XmlTest.msl | 0 .../xmlModel/XmlTest.ssdl | 0 .../App.config | 0 .../EF6.PG.csproj | 17 ++++++++++------ .../NpgsqlConnectionFactory.cs | 0 .../NpgsqlMigrationSqlGenerator.cs | 0 .../NpgsqlProviderManifest.cs | 0 .../NpgsqlRankingNormalization.cs | 0 .../NpgsqlServices.cs | 0 .../NpgsqlTextFunctions.cs | 0 .../NpgsqlTypeFunctions.cs | 0 .../NpgsqlWeightLabel.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../NpgsqlProviderManifest.Manifest.xml | 0 .../Resources/NpgsqlSchema.msl | 0 .../Resources/NpgsqlSchema.ssdl | 0 .../Resources/NpgsqlSchemaV3.ssdl | 0 .../Spatial/PostgisDataReader.cs | 0 .../Spatial/PostgisServices.cs | 0 .../SqlGenerators/PendingProjectsNode.cs | 0 .../SqlGenerators/SqlBaseGenerator.cs | 0 .../SqlGenerators/SqlDeleteGenerator.cs | 0 .../SqlGenerators/SqlInsertGenerator.cs | 0 .../SqlGenerators/SqlSelectGenerator.cs | 0 .../SqlGenerators/SqlUpdateGenerator.cs | 0 .../SqlGenerators/StringPair.cs | 0 .../SqlGenerators/VisitedExpression.cs | 0 EF6.PG/content/App.config.install.xdt | 9 +++++++++ EF6.PG/content/App.config.transform | 11 ++++++++++ EF6.PG/content/Web.config.install.xdt | 9 +++++++++ EF6.PG/content/Web.config.transform | 11 ++++++++++ EF6.PG/postgresql.png | Bin 0 -> 9675 bytes EntityFramework6.Npgsql.sln | 10 ++++----- src/EntityFramework6.Npgsql/install.ps1 | 3 --- .../EntityFramework6.Npgsql.Tests.csproj | 17 ---------------- 54 files changed, 94 insertions(+), 39 deletions(-) create mode 100644 Directory.Build.targets rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/App.config (95%) create mode 100644 EF6.PG.Tests/EF6.PG.Tests.csproj rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/EntityFrameworkBasicTests.cs (99%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/EntityFrameworkMigrationTests.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/FullTextSearchTests.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/NLogLoggingProvider.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/PatternMatchingTests.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/Spatial/PostgisServiceTests.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/Support/AssemblySetup.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/Support/CodeAnnotations.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/Support/EntityFrameworkTestBase.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/Support/TestBase.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/Support/TestDbConfiguration.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/Support/TestUtil.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/xmlModel/XmlTest.ObjectLayer.EF6.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/xmlModel/XmlTest.ObjectLayer.cs (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/xmlModel/XmlTest.csdl (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/xmlModel/XmlTest.msl (100%) rename {test/EntityFramework6.Npgsql.Tests => EF6.PG.Tests}/xmlModel/XmlTest.ssdl (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/App.config (100%) rename src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj => EF6.PG/EF6.PG.csproj (67%) rename {src/EntityFramework6.Npgsql => EF6.PG}/NpgsqlConnectionFactory.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/NpgsqlMigrationSqlGenerator.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/NpgsqlProviderManifest.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/NpgsqlRankingNormalization.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/NpgsqlServices.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/NpgsqlTextFunctions.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/NpgsqlTypeFunctions.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/NpgsqlWeightLabel.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/Properties/AssemblyInfo.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/Resources/NpgsqlProviderManifest.Manifest.xml (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/Resources/NpgsqlSchema.msl (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/Resources/NpgsqlSchema.ssdl (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/Resources/NpgsqlSchemaV3.ssdl (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/Spatial/PostgisDataReader.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/Spatial/PostgisServices.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/SqlGenerators/PendingProjectsNode.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/SqlGenerators/SqlBaseGenerator.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/SqlGenerators/SqlDeleteGenerator.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/SqlGenerators/SqlInsertGenerator.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/SqlGenerators/SqlSelectGenerator.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/SqlGenerators/SqlUpdateGenerator.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/SqlGenerators/StringPair.cs (100%) rename {src/EntityFramework6.Npgsql => EF6.PG}/SqlGenerators/VisitedExpression.cs (100%) create mode 100644 EF6.PG/content/App.config.install.xdt create mode 100644 EF6.PG/content/App.config.transform create mode 100644 EF6.PG/content/Web.config.install.xdt create mode 100644 EF6.PG/content/Web.config.transform create mode 100644 EF6.PG/postgresql.png delete mode 100644 src/EntityFramework6.Npgsql/install.ps1 delete mode 100644 test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj diff --git a/Directory.Build.props b/Directory.Build.props index d53ede3..c164035 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,13 +1,14 @@  - true + true + snupkg - + diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 0000000..37c0136 --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/test/EntityFramework6.Npgsql.Tests/App.config b/EF6.PG.Tests/App.config similarity index 95% rename from test/EntityFramework6.Npgsql.Tests/App.config rename to EF6.PG.Tests/App.config index 3bd6d0b..f113db7 100644 --- a/test/EntityFramework6.Npgsql.Tests/App.config +++ b/EF6.PG.Tests/App.config @@ -29,7 +29,7 @@ - + diff --git a/EF6.PG.Tests/EF6.PG.Tests.csproj b/EF6.PG.Tests/EF6.PG.Tests.csproj new file mode 100644 index 0000000..e2a05da --- /dev/null +++ b/EF6.PG.Tests/EF6.PG.Tests.csproj @@ -0,0 +1,19 @@ + + + latest + net45;netcoreapp3.0 + EntityFramework6.Npgsql.Tests + EntityFramework6.Npgsql.Tests + + + + + + + + + + + + + diff --git a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs b/EF6.PG.Tests/EntityFrameworkBasicTests.cs similarity index 99% rename from test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs rename to EF6.PG.Tests/EntityFrameworkBasicTests.cs index 180fb08..4e89635 100644 --- a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkBasicTests.cs +++ b/EF6.PG.Tests/EntityFrameworkBasicTests.cs @@ -17,7 +17,7 @@ namespace EntityFramework6.Npgsql.Tests { public class EntityFrameworkBasicTests : EntityFrameworkTestBase { - [Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/860")] + [Test] public void InsertAndSelect() { var varbitVal = "10011"; @@ -457,7 +457,7 @@ public void DateFunctions() //Hunting season is open Happy hunting on OrderBy,GroupBy,Min,Max,Skip,Take,ThenBy... and all posible combinations - [Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/861")] + [Test] public void TestComplicatedQueries() { using (var context = new BloggingContext(ConnectionString)) @@ -517,7 +517,7 @@ public void TestComplicatedQueries() } } - [Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/861")] + [Test] [MonoIgnore("Probably bug in mono. See https://github.com/npgsql/Npgsql/issues/289.")] public void TestComplicatedQueriesMonoFails() { @@ -541,7 +541,7 @@ public void TestComplicatedQueriesMonoFails() } } - [Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/861")] + [Test] public void TestComplicatedQueriesWithApply() { using (var conn = OpenConnection(ConnectionString)) diff --git a/test/EntityFramework6.Npgsql.Tests/EntityFrameworkMigrationTests.cs b/EF6.PG.Tests/EntityFrameworkMigrationTests.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/EntityFrameworkMigrationTests.cs rename to EF6.PG.Tests/EntityFrameworkMigrationTests.cs diff --git a/test/EntityFramework6.Npgsql.Tests/FullTextSearchTests.cs b/EF6.PG.Tests/FullTextSearchTests.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/FullTextSearchTests.cs rename to EF6.PG.Tests/FullTextSearchTests.cs diff --git a/test/EntityFramework6.Npgsql.Tests/NLogLoggingProvider.cs b/EF6.PG.Tests/NLogLoggingProvider.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/NLogLoggingProvider.cs rename to EF6.PG.Tests/NLogLoggingProvider.cs diff --git a/test/EntityFramework6.Npgsql.Tests/PatternMatchingTests.cs b/EF6.PG.Tests/PatternMatchingTests.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/PatternMatchingTests.cs rename to EF6.PG.Tests/PatternMatchingTests.cs diff --git a/test/EntityFramework6.Npgsql.Tests/Spatial/PostgisServiceTests.cs b/EF6.PG.Tests/Spatial/PostgisServiceTests.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/Spatial/PostgisServiceTests.cs rename to EF6.PG.Tests/Spatial/PostgisServiceTests.cs diff --git a/test/EntityFramework6.Npgsql.Tests/Support/AssemblySetup.cs b/EF6.PG.Tests/Support/AssemblySetup.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/Support/AssemblySetup.cs rename to EF6.PG.Tests/Support/AssemblySetup.cs diff --git a/test/EntityFramework6.Npgsql.Tests/Support/CodeAnnotations.cs b/EF6.PG.Tests/Support/CodeAnnotations.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/Support/CodeAnnotations.cs rename to EF6.PG.Tests/Support/CodeAnnotations.cs diff --git a/test/EntityFramework6.Npgsql.Tests/Support/EntityFrameworkTestBase.cs b/EF6.PG.Tests/Support/EntityFrameworkTestBase.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/Support/EntityFrameworkTestBase.cs rename to EF6.PG.Tests/Support/EntityFrameworkTestBase.cs diff --git a/test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs b/EF6.PG.Tests/Support/TestBase.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs rename to EF6.PG.Tests/Support/TestBase.cs diff --git a/test/EntityFramework6.Npgsql.Tests/Support/TestDbConfiguration.cs b/EF6.PG.Tests/Support/TestDbConfiguration.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/Support/TestDbConfiguration.cs rename to EF6.PG.Tests/Support/TestDbConfiguration.cs diff --git a/test/EntityFramework6.Npgsql.Tests/Support/TestUtil.cs b/EF6.PG.Tests/Support/TestUtil.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/Support/TestUtil.cs rename to EF6.PG.Tests/Support/TestUtil.cs diff --git a/test/EntityFramework6.Npgsql.Tests/xmlModel/XmlTest.ObjectLayer.EF6.cs b/EF6.PG.Tests/xmlModel/XmlTest.ObjectLayer.EF6.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/xmlModel/XmlTest.ObjectLayer.EF6.cs rename to EF6.PG.Tests/xmlModel/XmlTest.ObjectLayer.EF6.cs diff --git a/test/EntityFramework6.Npgsql.Tests/xmlModel/XmlTest.ObjectLayer.cs b/EF6.PG.Tests/xmlModel/XmlTest.ObjectLayer.cs similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/xmlModel/XmlTest.ObjectLayer.cs rename to EF6.PG.Tests/xmlModel/XmlTest.ObjectLayer.cs diff --git a/test/EntityFramework6.Npgsql.Tests/xmlModel/XmlTest.csdl b/EF6.PG.Tests/xmlModel/XmlTest.csdl similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/xmlModel/XmlTest.csdl rename to EF6.PG.Tests/xmlModel/XmlTest.csdl diff --git a/test/EntityFramework6.Npgsql.Tests/xmlModel/XmlTest.msl b/EF6.PG.Tests/xmlModel/XmlTest.msl similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/xmlModel/XmlTest.msl rename to EF6.PG.Tests/xmlModel/XmlTest.msl diff --git a/test/EntityFramework6.Npgsql.Tests/xmlModel/XmlTest.ssdl b/EF6.PG.Tests/xmlModel/XmlTest.ssdl similarity index 100% rename from test/EntityFramework6.Npgsql.Tests/xmlModel/XmlTest.ssdl rename to EF6.PG.Tests/xmlModel/XmlTest.ssdl diff --git a/src/EntityFramework6.Npgsql/App.config b/EF6.PG/App.config similarity index 100% rename from src/EntityFramework6.Npgsql/App.config rename to EF6.PG/App.config diff --git a/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj b/EF6.PG/EF6.PG.csproj similarity index 67% rename from src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj rename to EF6.PG/EF6.PG.csproj index 471878e..87cf8ba 100644 --- a/src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj +++ b/EF6.PG/EF6.PG.csproj @@ -12,12 +12,13 @@ CS1591 true Npgsql + EntityFramework6.Npgsql true - ../../Npgsql.snk + ../Npgsql.snk true true - http://www.npgsql.org - http://www.npgsql.org/img/postgresql.gif + https://github.com/npgsql/EntityFramework6.Npgsql + postgresql.png PostgreSQL git git://github.com/npgsql/EntityFramework6.Npgsql @@ -27,7 +28,11 @@ - + + + + + @@ -39,7 +44,7 @@ - - + + diff --git a/src/EntityFramework6.Npgsql/NpgsqlConnectionFactory.cs b/EF6.PG/NpgsqlConnectionFactory.cs similarity index 100% rename from src/EntityFramework6.Npgsql/NpgsqlConnectionFactory.cs rename to EF6.PG/NpgsqlConnectionFactory.cs diff --git a/src/EntityFramework6.Npgsql/NpgsqlMigrationSqlGenerator.cs b/EF6.PG/NpgsqlMigrationSqlGenerator.cs similarity index 100% rename from src/EntityFramework6.Npgsql/NpgsqlMigrationSqlGenerator.cs rename to EF6.PG/NpgsqlMigrationSqlGenerator.cs diff --git a/src/EntityFramework6.Npgsql/NpgsqlProviderManifest.cs b/EF6.PG/NpgsqlProviderManifest.cs similarity index 100% rename from src/EntityFramework6.Npgsql/NpgsqlProviderManifest.cs rename to EF6.PG/NpgsqlProviderManifest.cs diff --git a/src/EntityFramework6.Npgsql/NpgsqlRankingNormalization.cs b/EF6.PG/NpgsqlRankingNormalization.cs similarity index 100% rename from src/EntityFramework6.Npgsql/NpgsqlRankingNormalization.cs rename to EF6.PG/NpgsqlRankingNormalization.cs diff --git a/src/EntityFramework6.Npgsql/NpgsqlServices.cs b/EF6.PG/NpgsqlServices.cs similarity index 100% rename from src/EntityFramework6.Npgsql/NpgsqlServices.cs rename to EF6.PG/NpgsqlServices.cs diff --git a/src/EntityFramework6.Npgsql/NpgsqlTextFunctions.cs b/EF6.PG/NpgsqlTextFunctions.cs similarity index 100% rename from src/EntityFramework6.Npgsql/NpgsqlTextFunctions.cs rename to EF6.PG/NpgsqlTextFunctions.cs diff --git a/src/EntityFramework6.Npgsql/NpgsqlTypeFunctions.cs b/EF6.PG/NpgsqlTypeFunctions.cs similarity index 100% rename from src/EntityFramework6.Npgsql/NpgsqlTypeFunctions.cs rename to EF6.PG/NpgsqlTypeFunctions.cs diff --git a/src/EntityFramework6.Npgsql/NpgsqlWeightLabel.cs b/EF6.PG/NpgsqlWeightLabel.cs similarity index 100% rename from src/EntityFramework6.Npgsql/NpgsqlWeightLabel.cs rename to EF6.PG/NpgsqlWeightLabel.cs diff --git a/src/EntityFramework6.Npgsql/Properties/AssemblyInfo.cs b/EF6.PG/Properties/AssemblyInfo.cs similarity index 100% rename from src/EntityFramework6.Npgsql/Properties/AssemblyInfo.cs rename to EF6.PG/Properties/AssemblyInfo.cs diff --git a/src/EntityFramework6.Npgsql/Resources/NpgsqlProviderManifest.Manifest.xml b/EF6.PG/Resources/NpgsqlProviderManifest.Manifest.xml similarity index 100% rename from src/EntityFramework6.Npgsql/Resources/NpgsqlProviderManifest.Manifest.xml rename to EF6.PG/Resources/NpgsqlProviderManifest.Manifest.xml diff --git a/src/EntityFramework6.Npgsql/Resources/NpgsqlSchema.msl b/EF6.PG/Resources/NpgsqlSchema.msl similarity index 100% rename from src/EntityFramework6.Npgsql/Resources/NpgsqlSchema.msl rename to EF6.PG/Resources/NpgsqlSchema.msl diff --git a/src/EntityFramework6.Npgsql/Resources/NpgsqlSchema.ssdl b/EF6.PG/Resources/NpgsqlSchema.ssdl similarity index 100% rename from src/EntityFramework6.Npgsql/Resources/NpgsqlSchema.ssdl rename to EF6.PG/Resources/NpgsqlSchema.ssdl diff --git a/src/EntityFramework6.Npgsql/Resources/NpgsqlSchemaV3.ssdl b/EF6.PG/Resources/NpgsqlSchemaV3.ssdl similarity index 100% rename from src/EntityFramework6.Npgsql/Resources/NpgsqlSchemaV3.ssdl rename to EF6.PG/Resources/NpgsqlSchemaV3.ssdl diff --git a/src/EntityFramework6.Npgsql/Spatial/PostgisDataReader.cs b/EF6.PG/Spatial/PostgisDataReader.cs similarity index 100% rename from src/EntityFramework6.Npgsql/Spatial/PostgisDataReader.cs rename to EF6.PG/Spatial/PostgisDataReader.cs diff --git a/src/EntityFramework6.Npgsql/Spatial/PostgisServices.cs b/EF6.PG/Spatial/PostgisServices.cs similarity index 100% rename from src/EntityFramework6.Npgsql/Spatial/PostgisServices.cs rename to EF6.PG/Spatial/PostgisServices.cs diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/PendingProjectsNode.cs b/EF6.PG/SqlGenerators/PendingProjectsNode.cs similarity index 100% rename from src/EntityFramework6.Npgsql/SqlGenerators/PendingProjectsNode.cs rename to EF6.PG/SqlGenerators/PendingProjectsNode.cs diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/SqlBaseGenerator.cs b/EF6.PG/SqlGenerators/SqlBaseGenerator.cs similarity index 100% rename from src/EntityFramework6.Npgsql/SqlGenerators/SqlBaseGenerator.cs rename to EF6.PG/SqlGenerators/SqlBaseGenerator.cs diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/SqlDeleteGenerator.cs b/EF6.PG/SqlGenerators/SqlDeleteGenerator.cs similarity index 100% rename from src/EntityFramework6.Npgsql/SqlGenerators/SqlDeleteGenerator.cs rename to EF6.PG/SqlGenerators/SqlDeleteGenerator.cs diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/SqlInsertGenerator.cs b/EF6.PG/SqlGenerators/SqlInsertGenerator.cs similarity index 100% rename from src/EntityFramework6.Npgsql/SqlGenerators/SqlInsertGenerator.cs rename to EF6.PG/SqlGenerators/SqlInsertGenerator.cs diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/SqlSelectGenerator.cs b/EF6.PG/SqlGenerators/SqlSelectGenerator.cs similarity index 100% rename from src/EntityFramework6.Npgsql/SqlGenerators/SqlSelectGenerator.cs rename to EF6.PG/SqlGenerators/SqlSelectGenerator.cs diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/SqlUpdateGenerator.cs b/EF6.PG/SqlGenerators/SqlUpdateGenerator.cs similarity index 100% rename from src/EntityFramework6.Npgsql/SqlGenerators/SqlUpdateGenerator.cs rename to EF6.PG/SqlGenerators/SqlUpdateGenerator.cs diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/StringPair.cs b/EF6.PG/SqlGenerators/StringPair.cs similarity index 100% rename from src/EntityFramework6.Npgsql/SqlGenerators/StringPair.cs rename to EF6.PG/SqlGenerators/StringPair.cs diff --git a/src/EntityFramework6.Npgsql/SqlGenerators/VisitedExpression.cs b/EF6.PG/SqlGenerators/VisitedExpression.cs similarity index 100% rename from src/EntityFramework6.Npgsql/SqlGenerators/VisitedExpression.cs rename to EF6.PG/SqlGenerators/VisitedExpression.cs diff --git a/EF6.PG/content/App.config.install.xdt b/EF6.PG/content/App.config.install.xdt new file mode 100644 index 0000000..ace92ed --- /dev/null +++ b/EF6.PG/content/App.config.install.xdt @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/EF6.PG/content/App.config.transform b/EF6.PG/content/App.config.transform new file mode 100644 index 0000000..1dad58e --- /dev/null +++ b/EF6.PG/content/App.config.transform @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/EF6.PG/content/Web.config.install.xdt b/EF6.PG/content/Web.config.install.xdt new file mode 100644 index 0000000..ace92ed --- /dev/null +++ b/EF6.PG/content/Web.config.install.xdt @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/EF6.PG/content/Web.config.transform b/EF6.PG/content/Web.config.transform new file mode 100644 index 0000000..1dad58e --- /dev/null +++ b/EF6.PG/content/Web.config.transform @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/EF6.PG/postgresql.png b/EF6.PG/postgresql.png new file mode 100644 index 0000000000000000000000000000000000000000..3a21b19f7a164a0d7de90043974a06a273fdbd7b GIT binary patch literal 9675 zcmV;+B{bTJP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>DC16QJK~#8N?VSgd z6vfuZucRes5Lj{sU09+Z86=4a0uog~KrkQ(`cT0SP~hp4pdunD3KA7j1OdrWRDwhW zmYj3WaliW4bobn;8JN{lpOq!1%kjN4*d5aY5KyTv#z#vw6&7h|6oF=B*;a0&n(QdTiCiVbqQs~mMr|?hR%8*wUk-?|L5#n}I4H(m zF;=Gkd-i41PV$2cab1@*Gwqd6L;6XPt1|GB%!ZlkA z2nXJbpYRJWV3IqF@thb~ny~~sPV(f*DO({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f~dVQlBlony0S z&#wF(W1x`_>KhXsNnHovKnR++F5SRPY~H*%<;#~(_Th()fSLjnbRef62QnbHj~ALS zpzOitfRcAB7vVmM7wpfT-rzt7-uUri_}drZK8XlS8oYC!Cf3)$q{GSoq8PqgnI_UdT!`u-*n>#nMi2+NW#}$}cz)OmJ3@o#{{ban)HTt50$l(A N002ovPDHLkV1k}&RRI71 literal 0 HcmV?d00001 diff --git a/EntityFramework6.Npgsql.sln b/EntityFramework6.Npgsql.sln index 54bf88e..2609a94 100644 --- a/EntityFramework6.Npgsql.sln +++ b/EntityFramework6.Npgsql.sln @@ -5,16 +5,14 @@ VisualStudioVersion = 15.0.27703.2035 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4A5A60DD-41B6-40BF-B677-227A921ECCC8}" ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets Npgsql.snk = Npgsql.snk EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8537E50E-CF7F-49CB-B4EF-3E2A1B11F050}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EF6.PG", "EF6.PG\EF6.PG.csproj", "{3EC85CBA-5B79-11E3-8104-0022198AB089}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{ED612DB1-AB32-4603-95E7-891BACA71C39}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFramework6.Npgsql", "src\EntityFramework6.Npgsql\EntityFramework6.Npgsql.csproj", "{3EC85CBA-5B79-11E3-8104-0022198AB089}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFramework6.Npgsql.Tests", "test\EntityFramework6.Npgsql.Tests\EntityFramework6.Npgsql.Tests.csproj", "{4A0A42DE-C8B8-11E4-8EC9-005056A163A4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EF6.PG.Tests", "EF6.PG.Tests\EF6.PG.Tests.csproj", "{4A0A42DE-C8B8-11E4-8EC9-005056A163A4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/EntityFramework6.Npgsql/install.ps1 b/src/EntityFramework6.Npgsql/install.ps1 deleted file mode 100644 index b6b6c15..0000000 --- a/src/EntityFramework6.Npgsql/install.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -Add-EFProvider $project 'Npgsql' 'Npgsql.NpgsqlServices, EntityFramework6.Npgsql' diff --git a/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj b/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj deleted file mode 100644 index 5c8d4cf..0000000 --- a/test/EntityFramework6.Npgsql.Tests/EntityFramework6.Npgsql.Tests.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - latest - net45;netcoreapp3.0 - - - - - - - - - - - - - From 60c349a0363e15e4f01a4fdded2da5f6ec7d7723 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 10 Oct 2019 06:40:11 +0200 Subject: [PATCH 17/31] Bump version to 6.4.0 --- EF6.PG/EF6.PG.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EF6.PG/EF6.PG.csproj b/EF6.PG/EF6.PG.csproj index 87cf8ba..d3a5dd6 100644 --- a/EF6.PG/EF6.PG.csproj +++ b/EF6.PG/EF6.PG.csproj @@ -5,7 +5,7 @@ Copyright 2019 © The Npgsql Development Team Npgsql npgsql postgresql postgres data database entity framework ef orm - 6.3.0 + 6.4.0 latest net45;netstandard21 true From d120f9bed623017163a155ba77b03d43c829fded Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 4 Nov 2019 20:06:27 +0100 Subject: [PATCH 18/31] Stop using pg_attrdef.adsrc, obsoleted in PG12 Use pg_get_expr() on adbin instead Fixes #138 --- EF6.PG/Resources/NpgsqlSchema.ssdl | 4 ++-- EF6.PG/Resources/NpgsqlSchemaV3.ssdl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EF6.PG/Resources/NpgsqlSchema.ssdl b/EF6.PG/Resources/NpgsqlSchema.ssdl index 50df816..627ce10 100644 --- a/EF6.PG/Resources/NpgsqlSchema.ssdl +++ b/EF6.PG/Resources/NpgsqlSchema.ssdl @@ -57,7 +57,7 @@ end as is_identity, false as is_generated, -- default value column - ad.adsrc as default_value + pg_get_expr(ad.adbin, ad.adrelid) as default_value from pg_attribute a join pg_class c on a.attrelid = c.oid @@ -178,7 +178,7 @@ end as is_identity, false as is_generated, -- default value column - ad.adsrc as default_value + pg_get_expr(ad.adbin, ad.adrelid) as default_value from pg_attribute a join pg_class c on a.attrelid = c.oid diff --git a/EF6.PG/Resources/NpgsqlSchemaV3.ssdl b/EF6.PG/Resources/NpgsqlSchemaV3.ssdl index dd04ebd..4e84667 100644 --- a/EF6.PG/Resources/NpgsqlSchemaV3.ssdl +++ b/EF6.PG/Resources/NpgsqlSchemaV3.ssdl @@ -57,7 +57,7 @@ end as is_identity, false as is_generated, -- default value column - ad.adsrc as default_value + pg_get_expr(ad.adbin, ad.adrelid) as default_value from pg_attribute a join pg_class c on a.attrelid = c.oid @@ -178,7 +178,7 @@ end as is_identity, false as is_generated, -- default value column - ad.adsrc as default_value + pg_get_expr(ad.adbin, ad.adrelid) as default_value from pg_attribute a join pg_class c on a.attrelid = c.oid From 912cdee256c7ff4c09f237489d8c2d8f4c0ff448 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Wed, 4 Dec 2019 13:00:45 +0100 Subject: [PATCH 19/31] Use Npgsql 4.1 unless targeting net45 --- Directory.Build.targets | 12 ++++++++++-- EF6.PG.Tests/EF6.PG.Tests.csproj | 2 +- EF6.PG/EF6.PG.csproj | 4 ++-- EntityFramework6.Npgsql.sln | 7 +------ 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 37c0136..90c88d8 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,7 +1,15 @@ - + + + + + + + + + @@ -9,4 +17,4 @@ - \ No newline at end of file + diff --git a/EF6.PG.Tests/EF6.PG.Tests.csproj b/EF6.PG.Tests/EF6.PG.Tests.csproj index e2a05da..5f9b005 100644 --- a/EF6.PG.Tests/EF6.PG.Tests.csproj +++ b/EF6.PG.Tests/EF6.PG.Tests.csproj @@ -1,7 +1,7 @@  latest - net45;netcoreapp3.0 + net45;netcoreapp3.1 EntityFramework6.Npgsql.Tests EntityFramework6.Npgsql.Tests diff --git a/EF6.PG/EF6.PG.csproj b/EF6.PG/EF6.PG.csproj index d3a5dd6..86e2e0b 100644 --- a/EF6.PG/EF6.PG.csproj +++ b/EF6.PG/EF6.PG.csproj @@ -7,7 +7,7 @@ npgsql postgresql postgres data database entity framework ef orm 6.4.0 latest - net45;netstandard21 + net45;net461;netstandard21 true CS1591 true @@ -34,7 +34,7 @@ - + diff --git a/EntityFramework6.Npgsql.sln b/EntityFramework6.Npgsql.sln index 2609a94..d04e93d 100644 --- a/EntityFramework6.Npgsql.sln +++ b/EntityFramework6.Npgsql.sln @@ -1,5 +1,4 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27703.2035 MinimumVisualStudioVersion = 10.0.40219.1 @@ -32,10 +31,6 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {3EC85CBA-5B79-11E3-8104-0022198AB089} = {8537E50E-CF7F-49CB-B4EF-3E2A1B11F050} - {4A0A42DE-C8B8-11E4-8EC9-005056A163A4} = {ED612DB1-AB32-4603-95E7-891BACA71C39} - EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {84B4C9EA-ED4F-4E87-8809-297958315622} EndGlobalSection From c2099ef370a3f1febb7f533a169d81746c54237c Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Wed, 4 Dec 2019 13:07:40 +0100 Subject: [PATCH 20/31] Depend on EF 6.4.0 GA --- Directory.Build.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 90c88d8..f4ea8ab 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -10,10 +10,10 @@ - + - + From 91e37331b2da0f5bb30e7115cc9820f6eefc9123 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Fri, 6 Dec 2019 14:26:39 +0100 Subject: [PATCH 21/31] Depend on Microsoft.NETFramework.ReferenceAssemblies 1.0.0 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index c164035..3c65479 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,7 @@ - + From 7547263c3edf7d5d512fa61e766d22217df857c8 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 3 Feb 2020 10:29:08 +0100 Subject: [PATCH 22/31] Manage Npgsql ADO version better * Depend on Npgsql 4.1.3 * Differentiate Npgsql versions in App.config/Web.config transforms. Fixes #147 --- Directory.Build.targets | 8 ++++++-- EF6.PG/content/{ => net45}/App.config.transform | 0 EF6.PG/content/{ => net45}/Web.config.transform | 0 EF6.PG/content/net461/App.config.transform | 11 +++++++++++ EF6.PG/content/net461/Web.config.transform | 11 +++++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) rename EF6.PG/content/{ => net45}/App.config.transform (100%) rename EF6.PG/content/{ => net45}/Web.config.transform (100%) create mode 100644 EF6.PG/content/net461/App.config.transform create mode 100644 EF6.PG/content/net461/Web.config.transform diff --git a/Directory.Build.targets b/Directory.Build.targets index f4ea8ab..d3fa71d 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,10 +1,14 @@ - - + + + + diff --git a/EF6.PG/content/App.config.transform b/EF6.PG/content/net45/App.config.transform similarity index 100% rename from EF6.PG/content/App.config.transform rename to EF6.PG/content/net45/App.config.transform diff --git a/EF6.PG/content/Web.config.transform b/EF6.PG/content/net45/Web.config.transform similarity index 100% rename from EF6.PG/content/Web.config.transform rename to EF6.PG/content/net45/Web.config.transform diff --git a/EF6.PG/content/net461/App.config.transform b/EF6.PG/content/net461/App.config.transform new file mode 100644 index 0000000..0899448 --- /dev/null +++ b/EF6.PG/content/net461/App.config.transform @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/EF6.PG/content/net461/Web.config.transform b/EF6.PG/content/net461/Web.config.transform new file mode 100644 index 0000000..0899448 --- /dev/null +++ b/EF6.PG/content/net461/Web.config.transform @@ -0,0 +1,11 @@ + + + + + + + + + + + From 639d08636d5597cd2e102f449bf97138c30aa051 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 17 Feb 2020 13:51:29 +0100 Subject: [PATCH 23/31] Stop using pg_constraint.consrc, obsoleted in PG12 Use pg_get_expr() on conbin instead Fixes #143 --- EF6.PG/Resources/NpgsqlSchema.ssdl | 2 +- EF6.PG/Resources/NpgsqlSchemaV3.ssdl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EF6.PG/Resources/NpgsqlSchema.ssdl b/EF6.PG/Resources/NpgsqlSchema.ssdl index 627ce10..d40b9d4 100644 --- a/EF6.PG/Resources/NpgsqlSchema.ssdl +++ b/EF6.PG/Resources/NpgsqlSchema.ssdl @@ -78,7 +78,7 @@ c.condeferrable as is_deferrable, c.condeferred as is_initially_deferred, c.contype as constraint_type, - c.consrc as expression, + pg_get_expr(c.conbin, c.conrelid) as expression, case c.confupdtype when 'c' then 'CASCADE' when 'n' then 'SET NULL' diff --git a/EF6.PG/Resources/NpgsqlSchemaV3.ssdl b/EF6.PG/Resources/NpgsqlSchemaV3.ssdl index 4e84667..5411c61 100644 --- a/EF6.PG/Resources/NpgsqlSchemaV3.ssdl +++ b/EF6.PG/Resources/NpgsqlSchemaV3.ssdl @@ -78,7 +78,7 @@ c.condeferrable as is_deferrable, c.condeferred as is_initially_deferred, c.contype as constraint_type, - c.consrc as expression, + pg_get_expr(c.conbin, c.conrelid) as expression, case c.confupdtype when 'c' then 'CASCADE' when 'n' then 'SET NULL' From f411273199f482d84d72b3855b787346fc00d04c Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 17 Feb 2020 13:02:41 +0100 Subject: [PATCH 24/31] Bump version to 6.4.1 --- EF6.PG/EF6.PG.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EF6.PG/EF6.PG.csproj b/EF6.PG/EF6.PG.csproj index 86e2e0b..32fb4d7 100644 --- a/EF6.PG/EF6.PG.csproj +++ b/EF6.PG/EF6.PG.csproj @@ -5,7 +5,7 @@ Copyright 2019 © The Npgsql Development Team Npgsql npgsql postgresql postgres data database entity framework ef orm - 6.4.0 + 6.4.1 latest net45;net461;netstandard21 true From 652534c1c91105b7c62eb04f409ffa5f723fe44f Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 17 Feb 2020 13:09:02 +0100 Subject: [PATCH 25/31] Update copyright year --- EF6.PG/EF6.PG.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EF6.PG/EF6.PG.csproj b/EF6.PG/EF6.PG.csproj index 32fb4d7..66ebbde 100644 --- a/EF6.PG/EF6.PG.csproj +++ b/EF6.PG/EF6.PG.csproj @@ -2,7 +2,7 @@ PostgreSQL provider for Entity Framework 6 Shay Rojansky;Emil Lenngren;Francisco Figueiredo Jr.;Kenji Uno - Copyright 2019 © The Npgsql Development Team + Copyright 2020 © The Npgsql Development Team Npgsql npgsql postgresql postgres data database entity framework ef orm 6.4.1 From f07c45c764e461038c1d2d4ba5da43e8c1b403c9 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 17 Feb 2020 13:12:08 +0100 Subject: [PATCH 26/31] Fix transforms management per TFM Leftover from 7547263c3edf7d5d512fa61e766d22217df857c8 --- EF6.PG/EF6.PG.csproj | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/EF6.PG/EF6.PG.csproj b/EF6.PG/EF6.PG.csproj index 66ebbde..7357dd0 100644 --- a/EF6.PG/EF6.PG.csproj +++ b/EF6.PG/EF6.PG.csproj @@ -29,9 +29,15 @@ - + - + + + + + + + From 55c19004838451d62e364fa7da38b6cf3b471640 Mon Sep 17 00:00:00 2001 From: Duy-KMS <59947708+Duy-KMS@users.noreply.github.com> Date: Sun, 15 Mar 2020 16:28:48 +0700 Subject: [PATCH 27/31] Error while calling Postgresql function by using Database First (#151) Closes #150 --- EF6.PG.Tests/EntityFrameworkBasicTests.cs | 25 ++++++++ .../Support/EntityFrameworkTestBase.cs | 64 +++++++++++++++++++ EF6.PG/NpgsqlServices.cs | 3 + EF6.PG/SqlGenerators/SqlFunctionGenerator.cs | 22 +++++++ 4 files changed, 114 insertions(+) create mode 100644 EF6.PG/SqlGenerators/SqlFunctionGenerator.cs diff --git a/EF6.PG.Tests/EntityFrameworkBasicTests.cs b/EF6.PG.Tests/EntityFrameworkBasicTests.cs index 4e89635..cb52e3d 100644 --- a/EF6.PG.Tests/EntityFrameworkBasicTests.cs +++ b/EF6.PG.Tests/EntityFrameworkBasicTests.cs @@ -889,5 +889,30 @@ public void Test_enum_composite_key() Assert.That(result.TestLong, Is.EqualTo(TestLongEnum.Bar)); } } + + [Test] + public void Test_non_composable_function() + { + using (var context = new BloggingContext(ConnectionString)) + { + context.Database.Log = Console.Out.WriteLine; + + // Add some data and query it back using Stored Function + context.Blogs.Add(new Blog + { + Name = "Some blog1 name", + Posts = new List() + }); + context.SaveChanges(); + + // Query back + var nameParameter = new ObjectParameter("Name", "blog1"); + var blogs = ((IObjectContextAdapter)context).ObjectContext.ExecuteFunction("GetBlogsByName2", nameParameter).ToArray(); + + Assert.AreEqual(1, blogs.Length); + Assert.AreEqual("Some blog1 name", blogs[0].Name); + } + } + } } diff --git a/EF6.PG.Tests/Support/EntityFrameworkTestBase.cs b/EF6.PG.Tests/Support/EntityFrameworkTestBase.cs index d07af64..5504281 100644 --- a/EF6.PG.Tests/Support/EntityFrameworkTestBase.cs +++ b/EF6.PG.Tests/Support/EntityFrameworkTestBase.cs @@ -38,6 +38,7 @@ public abstract class EntityFrameworkTestBase : TestBase createSequenceConn.ExecuteNonQuery("CREATE OR REPLACE FUNCTION \"dbo\".\"StoredAddFunction\"(integer, integer) RETURNS integer AS $$ SELECT $1 + $2; $$ LANGUAGE SQL;"); createSequenceConn.ExecuteNonQuery("CREATE OR REPLACE FUNCTION \"dbo\".\"StoredEchoFunction\"(integer) RETURNS integer AS $$ SELECT $1; $$ LANGUAGE SQL;"); createSequenceConn.ExecuteNonQuery("CREATE OR REPLACE FUNCTION \"dbo\".\"GetBlogsByName\"(text) RETURNS TABLE(\"BlogId\" int, \"Name\" text, \"IntComputedValue\" int) as $$ select \"BlogId\", \"Name\", \"IntComputedValue\" from \"dbo\".\"Blogs\" where \"Name\" ilike '%' || $1 || '%' $$ LANGUAGE SQL;"); + createSequenceConn.ExecuteNonQuery("CREATE OR REPLACE FUNCTION \"dbo\".\"GetBlogsByName2\"(text) RETURNS TABLE(\"BlogId\" int, \"Name\" text, \"IntComputedValue\" int) as $$ select \"BlogId\", \"Name\", \"IntComputedValue\" from \"dbo\".\"Blogs\" where \"Name\" ilike '%' || $1 || '%' $$ LANGUAGE SQL;"); } } @@ -336,8 +337,71 @@ private static DbCompiledModel CreateModel(NpgsqlConnection connection) new FunctionImportResultMapping(), dbModel.ConceptualToStoreMapping)); + + var getBlogs2Func = EdmFunction.Create( + "GetBlogsByName2", + "BloggingContext", + DataSpace.SSpace, + new EdmFunctionPayload + { + ParameterTypeSemantics = ParameterTypeSemantics.AllowImplicitConversion, + Schema = "dbo", + IsComposable = false, + IsNiladic = false, + IsBuiltIn = false, + IsAggregate = false, + StoreFunctionName = "GetBlogsByName2", + ReturnParameters = new[] + { + FunctionParameter.Create("ReturnType1", rowType.GetCollectionType(), ParameterMode.ReturnValue) + }, + Parameters = new[] + { + FunctionParameter.Create("Name", stringStoreType, ParameterMode.In) + } + }, + null); + dbModel.StoreModel.AddItem(getBlogs2Func); + + EdmFunction getBlogs2FuncModel = EdmFunction.Create( + "GetBlogsByName2", + dbModel.ConceptualModel.Container.Name, + DataSpace.CSpace, + new EdmFunctionPayload + { + IsFunctionImport = true, + IsComposable = false, + Parameters = new[] + { + FunctionParameter.Create("Name", stringPrimitiveType, ParameterMode.In) + }, + ReturnParameters = new[] + { + FunctionParameter.Create("ReturnType1", modelBlogConceptualType.GetCollectionType(), ParameterMode.ReturnValue) + }, + EntitySets = new[] + { + dbModel.ConceptualModel.Container.EntitySets.First(x => x.ElementType == modelBlogConceptualType) + } + }, + null); + dbModel.ConceptualModel.Container.AddFunctionImport(getBlogs2FuncModel); + + dbModel.ConceptualToStoreMapping.AddFunctionImportMapping(new FunctionImportMappingNonComposable( + getBlogs2FuncModel, + getBlogs2Func, + new FunctionImportResultMapping[] { }, + dbModel.ConceptualToStoreMapping)); + + var compiledModel = dbModel.Compile(); return compiledModel; } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + //modelBuilder.Conventions.Add(new FunctionsConvention("dbo")); + base.OnModelCreating(modelBuilder); + } } } diff --git a/EF6.PG/NpgsqlServices.cs b/EF6.PG/NpgsqlServices.cs index 0a0351d..4c9fe93 100644 --- a/EF6.PG/NpgsqlServices.cs +++ b/EF6.PG/NpgsqlServices.cs @@ -79,6 +79,7 @@ internal void TranslateCommandTree(Version serverVersion, DbCommandTree commandT DbInsertCommandTree insert; DbUpdateCommandTree update; DbDeleteCommandTree delete; + DbFunctionCommandTree function; if ((select = commandTree as DbQueryCommandTree) != null) sqlGenerator = new SqlSelectGenerator(select); else if ((insert = commandTree as DbInsertCommandTree) != null) @@ -87,6 +88,8 @@ internal void TranslateCommandTree(Version serverVersion, DbCommandTree commandT sqlGenerator = new SqlUpdateGenerator(update); else if ((delete = commandTree as DbDeleteCommandTree) != null) sqlGenerator = new SqlDeleteGenerator(delete); + else if ((function = commandTree as DbFunctionCommandTree) != null) + sqlGenerator = new SqlFunctionGenerator(function); else { // TODO: get a message (unsupported DbCommandTree type) diff --git a/EF6.PG/SqlGenerators/SqlFunctionGenerator.cs b/EF6.PG/SqlGenerators/SqlFunctionGenerator.cs new file mode 100644 index 0000000..25ed47c --- /dev/null +++ b/EF6.PG/SqlGenerators/SqlFunctionGenerator.cs @@ -0,0 +1,22 @@ +using System.Linq; +using System.Data.Common; +using System.Data.Entity.Core.Common.CommandTrees; + +namespace Npgsql.SqlGenerators +{ + class SqlFunctionGenerator : SqlBaseGenerator + { + readonly DbFunctionCommandTree _commandTree; + + public SqlFunctionGenerator(DbFunctionCommandTree commandTree) + { + _commandTree = commandTree; + } + + public override void BuildCommand(DbCommand command) + { + var paramStr = string.Join(",", command.Parameters.OfType().Select(x => "@" + x.ParameterName).ToArray()); + command.CommandText = $"SELECT * FROM { QuoteIdentifier(_commandTree.EdmFunction.Schema) }.{ QuoteIdentifier(_commandTree.EdmFunction.Name) } ({paramStr})"; + } + } +} From 9298acdc299133c93cc9cbbd2fbf67589f057fbc Mon Sep 17 00:00:00 2001 From: HoberMellow Date: Thu, 20 May 2021 00:34:58 +0400 Subject: [PATCH 28/31] Add check for null db parameter value (#161) --- EF6.PG/NpgsqlServices.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EF6.PG/NpgsqlServices.cs b/EF6.PG/NpgsqlServices.cs index 4c9fe93..4108f76 100644 --- a/EF6.PG/NpgsqlServices.cs +++ b/EF6.PG/NpgsqlServices.cs @@ -60,6 +60,11 @@ protected override void SetDbParameterValue(DbParameter parameter, TypeUsage par // Npgsql > 4.0 does strict type checks on integral values and fails with enums passed with numeric DbType. static void ConvertValueToNumericIfEnum(DbParameter parameter) { + if (parameter.Value == null) + { + return; + } + var parameterValueObjectType = parameter.Value.GetType(); if (!parameterValueObjectType.IsEnum) From 2fe32bc9b609bc74a99bbcf344e22e8797a59d0c Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Wed, 19 May 2021 22:37:19 +0200 Subject: [PATCH 29/31] Bump version to 6.4.2 --- EF6.PG/EF6.PG.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EF6.PG/EF6.PG.csproj b/EF6.PG/EF6.PG.csproj index 7357dd0..90bf865 100644 --- a/EF6.PG/EF6.PG.csproj +++ b/EF6.PG/EF6.PG.csproj @@ -5,7 +5,7 @@ Copyright 2020 © The Npgsql Development Team Npgsql npgsql postgresql postgres data database entity framework ef orm - 6.4.1 + 6.4.2 latest net45;net461;netstandard21 true From 4b54a479d6975b9b39c79dc310664e735a1719b4 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Wed, 19 May 2021 22:37:19 +0200 Subject: [PATCH 30/31] Bump version to 6.4.3 --- EF6.PG/EF6.PG.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EF6.PG/EF6.PG.csproj b/EF6.PG/EF6.PG.csproj index 90bf865..b84b9bc 100644 --- a/EF6.PG/EF6.PG.csproj +++ b/EF6.PG/EF6.PG.csproj @@ -5,7 +5,7 @@ Copyright 2020 © The Npgsql Development Team Npgsql npgsql postgresql postgres data database entity framework ef orm - 6.4.2 + 6.4.3 latest net45;net461;netstandard21 true From a6f9e5954a0c9821f739952ba52051fca74618df Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 18 Aug 2022 12:55:39 +0200 Subject: [PATCH 31/31] Add README Closes #187 --- README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a00fdb6 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Entity Framework 6 Provider for PostgreSQL + +This is the Npgsql PostgreSQL provider for Entity Framework 6; note that this is the old, non-core version of EF. For the EF Core provider, see https://github.com/npgsql/efcore.pg. + +Like non-core Entity Framework 6, this provider is no longer being maintained. It is unlikely that any enhancements or bug fixes will be worked upon, unless they're absolutely critical. \ No newline at end of file