Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .NET/EF 9.0 GA #3361

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<EFCoreVersion>[9.0.0-rc.2.24474.1]</EFCoreVersion>
<MicrosoftExtensionsVersion>9.0.0-rc.2.24473.5</MicrosoftExtensionsVersion>
<EFCoreVersion>[9.0.0,10.0.0)</EFCoreVersion>
<MicrosoftExtensionsVersion>9.0.0</MicrosoftExtensionsVersion>
<NpgsqlVersion>9.0.0-preview.1-ci.20241028T080028</NpgsqlVersion>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "9.0.100-rc.2.24474.11",
"version": "9.0.100",
"rollForward": "latestMajor",
"allowPrerelease": true
"allowPrerelease": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ namespace Npgsql.EntityFrameworkCore.PostgreSQL.Migrations
public class MigrationsInfrastructureNpgsqlTest(MigrationsInfrastructureNpgsqlTest.MigrationsInfrastructureNpgsqlFixture fixture)
: MigrationsInfrastructureTestBase<MigrationsInfrastructureNpgsqlTest.MigrationsInfrastructureNpgsqlFixture>(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();
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<DbUpdateException>(
() => 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<DbUpdateException>(
() => 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<DbUpdateException>(
() => 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<DbUpdateException>(
() => base.Projecting_one_of_two_similar_complex_types_picks_the_correct_one());
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down