From 12972d0cb4cc852aed4699e30643207746724b24 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Tue, 12 Nov 2024 20:32:56 +0100 Subject: [PATCH] Use .NET/EF 9.0 GA --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- Directory.Packages.props | 4 +-- global.json | 4 +-- .../MigrationsInfrastructureNpgsqlTest.cs | 13 +++++++++ .../AdHocAdvancedMappingsQueryNpgsqlTest.cs | 15 ++++++++++ .../Query/AdHocPrecompiledQueryNpgsqlTest.cs | 29 +++++++++++++++++++ 7 files changed, 63 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index adff570bf..fca39f9ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ on: pull_request: env: - dotnet_sdk_version: '9.0.100-rc.2.24474.11' + dotnet_sdk_version: '9.0.100' postgis_version: 3 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 655cd1811..c5e68a34c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -27,7 +27,7 @@ on: - cron: '30 22 * * 6' env: - dotnet_sdk_version: '9.0.100-rc.2.24474.11' + dotnet_sdk_version: '9.0.100' jobs: analyze: diff --git a/Directory.Packages.props b/Directory.Packages.props index 1bd68eb76..949ee8f56 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,7 +1,7 @@ - [9.0.0-rc.2.24474.1] - 9.0.0-rc.2.24473.5 + [9.0.0,10.0.0) + 9.0.0 9.0.0-preview.1-ci.20241028T080028 diff --git a/global.json b/global.json index 58f954fc2..733b653c1 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "9.0.100-rc.2.24474.11", + "version": "9.0.100", "rollForward": "latestMajor", - "allowPrerelease": true + "allowPrerelease": false } } diff --git a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs index c87d9507a..a67c241fa 100644 --- a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs @@ -7,6 +7,16 @@ namespace Npgsql.EntityFrameworkCore.PostgreSQL.Migrations public class MigrationsInfrastructureNpgsqlTest(MigrationsInfrastructureNpgsqlTest.MigrationsInfrastructureNpgsqlFixture fixture) : MigrationsInfrastructureTestBase(fixture) { + // TODO: Remove once we sync to https://github.com/dotnet/efcore/pull/35106 + public override void Can_generate_no_migration_script() + { + } + + // TODO: Remove once we sync to https://github.com/dotnet/efcore/pull/35106 + public override void Can_generate_migration_from_initial_database_to_initial() + { + } + public override void Can_get_active_provider() { base.Can_get_active_provider(); @@ -159,6 +169,9 @@ public override void Can_diff_against_2_1_ASP_NET_Identity_model() // TODO: Implement } + protected override Task ExecuteSqlAsync(string value) + => ((NpgsqlTestStore)Fixture.TestStore).ExecuteNonQueryAsync(value); + public class MigrationsInfrastructureNpgsqlFixture : MigrationsInfrastructureFixtureBase { protected override ITestStoreFactory TestStoreFactory diff --git a/test/EFCore.PG.FunctionalTests/Query/AdHocAdvancedMappingsQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/AdHocAdvancedMappingsQueryNpgsqlTest.cs index 0a2e11cce..a3bafed45 100644 --- a/test/EFCore.PG.FunctionalTests/Query/AdHocAdvancedMappingsQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/AdHocAdvancedMappingsQueryNpgsqlTest.cs @@ -21,4 +21,19 @@ public override Task Query_generates_correct_datetimeoffset_parameter_definition public override Task Projecting_one_of_two_similar_complex_types_picks_the_correct_one() => Assert.ThrowsAsync( () => base.Projecting_one_of_two_similar_complex_types_picks_the_correct_one()); + + // Cannot write DateTimeOffset with Offset=10:00:00 to PostgreSQL type 'timestamp with time zone', only offset 0 (UTC) is supported. + public override Task Projecting_expression_with_converter_with_closure(bool async) + => Assert.ThrowsAsync( + () => base.Projecting_one_of_two_similar_complex_types_picks_the_correct_one()); + + // Cannot write DateTimeOffset with Offset=10:00:00 to PostgreSQL type 'timestamp with time zone', only offset 0 (UTC) is supported. + public override Task Projecting_property_with_converter_with_closure(bool async) + => Assert.ThrowsAsync( + () => base.Projecting_one_of_two_similar_complex_types_picks_the_correct_one()); + + // Cannot write DateTimeOffset with Offset=10:00:00 to PostgreSQL type 'timestamp with time zone', only offset 0 (UTC) is supported. + public override Task Projecting_property_with_converter_without_closure(bool async) + => Assert.ThrowsAsync( + () => base.Projecting_one_of_two_similar_complex_types_picks_the_correct_one()); } diff --git a/test/EFCore.PG.FunctionalTests/Query/AdHocPrecompiledQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/AdHocPrecompiledQueryNpgsqlTest.cs index f97055924..8839ca80e 100644 --- a/test/EFCore.PG.FunctionalTests/Query/AdHocPrecompiledQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/AdHocPrecompiledQueryNpgsqlTest.cs @@ -69,6 +69,35 @@ LIMIT 2 """); } + public override async Task Projecting_property_requiring_converter_with_closure_is_not_supported() + { + await base.Projecting_property_requiring_converter_with_closure_is_not_supported(); + + AssertSql(); + } + + public override async Task Projecting_expression_requiring_converter_without_closure_works() + { + await base.Projecting_expression_requiring_converter_without_closure_works(); + + AssertSql( + """ +SELECT b."AudiobookDate" +FROM "Books" AS b +"""); + } + + public override async Task Projecting_entity_with_property_requiring_converter_with_closure_works() + { + await base.Projecting_entity_with_property_requiring_converter_with_closure_works(); + + AssertSql( + """ +SELECT b."Id", b."AudiobookDate", b."Name", b."PublishDate" +FROM "Books" AS b +"""); + } + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType());