diff --git a/test/EFCore.PG.FunctionalTests/Query/NorthwindQueryNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/NorthwindQueryNpgsqlFixture.cs index c74ed4633..da3465a61 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NorthwindQueryNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NorthwindQueryNpgsqlFixture.cs @@ -11,15 +11,6 @@ public class NorthwindQueryNpgsqlFixture : NorthwindQueryRelat protected override ITestStoreFactory TestStoreFactory => NpgsqlNorthwindTestStoreFactory.Instance; protected override Type ContextType => typeof(NorthwindNpgsqlContext); - static NorthwindQueryNpgsqlFixture() - { - // TODO: Switch to using NpgsqlDataSource -#pragma warning disable CS0618 // Type or member is obsolete - NpgsqlConnection.GlobalTypeMapper.EnableDynamicJsonMappings(); - NpgsqlConnection.GlobalTypeMapper.EnableRecordsAsTuples(); -#pragma warning restore CS0618 // Type or member is obsolete - } - public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) { var optionsBuilder = base.AddOptions(builder); diff --git a/test/EFCore.PG.FunctionalTests/TestUtilities/NpgsqlNorthwindTestStoreFactory.cs b/test/EFCore.PG.FunctionalTests/TestUtilities/NpgsqlNorthwindTestStoreFactory.cs index 856dabef9..f7329fc55 100644 --- a/test/EFCore.PG.FunctionalTests/TestUtilities/NpgsqlNorthwindTestStoreFactory.cs +++ b/test/EFCore.PG.FunctionalTests/TestUtilities/NpgsqlNorthwindTestStoreFactory.cs @@ -6,6 +6,15 @@ public class NpgsqlNorthwindTestStoreFactory : NpgsqlTestStoreFactory public static readonly string NorthwindConnectionString = NpgsqlTestStore.CreateConnectionString(Name); public new static NpgsqlNorthwindTestStoreFactory Instance { get; } = new(); + static NpgsqlNorthwindTestStoreFactory() + { + // TODO: Switch to using NpgsqlDataSource +#pragma warning disable CS0618 // Type or member is obsolete + NpgsqlConnection.GlobalTypeMapper.EnableDynamicJsonMappings(); + NpgsqlConnection.GlobalTypeMapper.EnableRecordsAsTuples(); +#pragma warning restore CS0618 // Type or member is obsolete + } + protected NpgsqlNorthwindTestStoreFactory() { } @@ -15,4 +24,4 @@ public override TestStore GetOrCreate(string storeName) TestEnvironment.PostgresVersion >= new Version(12, 0) ? @"CREATE COLLATION IF NOT EXISTS ""some-case-insensitive-collation"" (LOCALE = 'en-u-ks-primary', PROVIDER = icu, DETERMINISTIC = False);" : null); -} \ No newline at end of file +}