Skip to content

Commit a650b9b

Browse files
author
vizkeleti.ferenc
committed
Updated TargetFramework and EFCore package references to 10.0 in all projects.
Adapted tests to breaking changes in RelationalTestStore and MigrationsInfrastructureTestBase.ExecuteSqlAsync. 4 tests are failing.
1 parent 98162c6 commit a650b9b

10 files changed

Lines changed: 54 additions & 39 deletions

File tree

benchmarks/Eftdb.Benchmarks/Eftdb.Benchmarks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Benchmarks</AssemblyName>
@@ -16,7 +16,7 @@
1616
<ItemGroup>
1717
<PackageReference Include="BenchmarkDotNet" Version="0.15.2" />
1818
<PackageReference Include="Testcontainers.PostgreSql" Version="4.7.0" />
19-
<PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="9.103.9.3" />
19+
<PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="10.105.0" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

samples/Eftdb.Samples.CodeFirst/Eftdb.Samples.CodeFirst.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Samples.CodeFirst</AssemblyName>
99
<RootNamespace>CmdScale.EntityFrameworkCore.TimescaleDB.Samples.CodeFirst</RootNamespace>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="EFCore.NamingConventions" Version="9.0.0" />
14-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
13+
<PackageReference Include="EFCore.NamingConventions" Version="10.0.0-rc.2" />
14+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

samples/Eftdb.Samples.DatabaseFirst/Eftdb.Samples.DatabaseFirst.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</ItemGroup>
66

77
<PropertyGroup>
8-
<TargetFramework>net8.0</TargetFramework>
8+
<TargetFramework>net10.0</TargetFramework>
99
<ImplicitUsings>enable</ImplicitUsings>
1010
<Nullable>enable</Nullable>
1111
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Samples.DatabaseFirst</AssemblyName>

samples/Eftdb.Samples.Shared/Eftdb.Samples.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</ItemGroup>
66

77
<PropertyGroup>
8-
<TargetFramework>net8.0</TargetFramework>
8+
<TargetFramework>net10.0</TargetFramework>
99
<ImplicitUsings>enable</ImplicitUsings>
1010
<Nullable>enable</Nullable>
1111
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Samples.Shared</AssemblyName>

src/Eftdb.Design/Eftdb.Design.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Design</AssemblyName>
77
<RootNamespace>CmdScale.EntityFrameworkCore.TimescaleDB.Design</RootNamespace>
88
<PackageId>CmdScale.EntityFrameworkCore.TimescaleDB.Design</PackageId>
9-
<Version>0.3.3</Version>
9+
<Version>0.4.0</Version>
1010
<Authors>CmdScale</Authors>
1111
<Description>Provides crucial design-time extensions. This package enhances the EF Core CLI tools (dotnet ef) to understand TimescaleDB concepts, enabling correct schema generation for migrations and scaffolding.</Description>
1212
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -24,7 +24,7 @@
2424
<PackageTags>timescaledb;timescale;efcore;ef-core;entityframeworkcore;postgresql;postgres;time-series;timeseries;data;database;efcore-provider;provider;design;migrations;scaffolding;codegen;cli;tools</PackageTags>
2525
</PropertyGroup>
2626
<ItemGroup>
27-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.8" />
27+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0" />
2828
</ItemGroup>
2929
<ItemGroup>
3030
<None Include="..\..\assets\cmd-nuget-logo.jpg">

src/Eftdb/Eftdb.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB</AssemblyName>
77
<RootNamespace>CmdScale.EntityFrameworkCore.TimescaleDB</RootNamespace>
88
<PackageId>CmdScale.EntityFrameworkCore.TimescaleDB</PackageId>
9-
<Version>0.3.3</Version>
9+
<Version>0.4.0</Version>
1010
<Authors>CmdScale</Authors>
1111
<Description>The core runtime library. You include this in your project to enable TimescaleDB-specific features when configuring your DbContext.</Description>
1212
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -38,6 +38,6 @@
3838
</None>
3939
</ItemGroup>
4040
<ItemGroup>
41-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
41+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" />
4242
</ItemGroup>
4343
</Project>

tests/Eftdb.FunctionalTests/Eftdb.FunctionalTests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.FunctionalTests</AssemblyName>
@@ -16,11 +16,11 @@
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
</PackageReference>
19-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.21" />
20-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="8.0.21" />
19+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.0" />
20+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="10.0.0" />
2121
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
22-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="9.0.4" />
23-
<PackageReference Include="Npgsql.NetTopologySuite" Version="9.0.4" />
22+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="10.0.0" />
23+
<PackageReference Include="Npgsql.NetTopologySuite" Version="10.0.0" />
2424
<PackageReference Include="Testcontainers.PostgreSql" Version="4.8.1" />
2525
<PackageReference Include="xunit" Version="2.9.3" />
2626
<PackageReference Include="xunit.assert" Version="2.9.3" />

tests/Eftdb.FunctionalTests/TimescaleDbMigrationsInfrastructureTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ public TimescaleDbMigrationsInfrastructureTests(TimescaleMigrationsFixture fixtu
7575
Fixture.ListLoggerFactory.Clear();
7676
}
7777

78+
protected override Task ExecuteSqlAsync(string value)
79+
{
80+
((TimescaleTestStore)Fixture.TestStore).ExecuteScript(value);
81+
return Task.CompletedTask;
82+
}
83+
7884
[ConditionalFact]
7985
public override void Can_diff_against_2_1_ASP_NET_Identity_model()
8086
{

tests/Eftdb.FunctionalTests/Utils/TimescaleTestStore.cs

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,17 @@
33
using Microsoft.EntityFrameworkCore.TestUtilities;
44
using Npgsql;
55
using System.Collections.Concurrent;
6-
using System.Data.Common;
6+
using System.Data;
77

88
namespace CmdScale.EntityFrameworkCore.TimescaleDB.FunctionalTests.Utils;
99

1010
public class TimescaleTestStore : RelationalTestStore
1111
{
1212
private static readonly ConcurrentDictionary<string, TimescaleTestStore> _sharedStores = new();
1313

14-
protected override DbConnection Connection { get => base.Connection; set => base.Connection = value; }
15-
public override string ConnectionString { get => base.ConnectionString; protected set => base.ConnectionString = value; }
16-
1714
private TimescaleTestStore(string name, bool shared, string connectionString)
18-
: base(name, shared)
15+
: base(name, shared, new NpgsqlConnection(connectionString))
1916
{
20-
ConnectionString = connectionString;
21-
Connection = new NpgsqlConnection(ConnectionString);
2217
}
2318

2419
public static TimescaleTestStore Create(string name, string connectionString)
@@ -29,19 +24,33 @@ public static TimescaleTestStore GetOrCreateShared(string name, string connectio
2924
{
3025
TimescaleTestStore store = new(name, shared: true, connectionString);
3126

32-
DbContextOptions<MigrationsInfrastructureFixtureBase.MigrationsContext> options = new DbContextOptionsBuilder<MigrationsInfrastructureFixtureBase.MigrationsContext>()
33-
.UseNpgsql(connectionString).UseTimescaleDb().Options;
34-
store.Initialize(null, () => new MigrationsInfrastructureFixtureBase.MigrationsContext(options), null);
27+
DbContextOptions<MigrationsInfrastructureFixtureBase.MigrationsContext> options =
28+
new DbContextOptionsBuilder<MigrationsInfrastructureFixtureBase.MigrationsContext>()
29+
.UseNpgsql(connectionString).UseTimescaleDb().Options;
30+
var __ = store.InitializeAsync(null,
31+
() => new MigrationsInfrastructureFixtureBase.MigrationsContext(options), null).Result;
3532
return store;
3633
});
3734

3835
public override DbContextOptionsBuilder AddProviderOptions(DbContextOptionsBuilder builder)
39-
=> builder.AddInterceptors(new TimescaleMigrationsTestInterceptor()).UseNpgsql(ConnectionString, options =>
40-
{
41-
}).UseTimescaleDb().EnableSensitiveDataLogging();
36+
=> builder.AddInterceptors(new TimescaleMigrationsTestInterceptor()).UseNpgsql(ConnectionString, options => { })
37+
.UseTimescaleDb().EnableSensitiveDataLogging();
4238

43-
public override void Clean(DbContext context)
39+
public override Task CleanAsync(DbContext context)
4440
{
4541
context.Database.EnsureClean();
42+
return Task.CompletedTask;
43+
}
44+
45+
public void ExecuteScript(string script)
46+
{
47+
if (ConnectionState != ConnectionState.Open)
48+
Connection.Open();
49+
50+
using (var cmd = Connection.CreateCommand())
51+
{
52+
cmd.CommandText = script;
53+
cmd.ExecuteNonQuery();
54+
}
4655
}
47-
}
56+
}

tests/Eftdb.Tests/Eftdb.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Tests</AssemblyName>
@@ -16,8 +16,8 @@
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
</PackageReference>
19-
<PackageReference Include="EFCore.NamingConventions" Version="9.0.0" />
20-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.8" />
19+
<PackageReference Include="EFCore.NamingConventions" Version="10.0.0-rc.2" />
20+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0" />
2121
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
2222
<PackageReference Include="Moq" Version="4.20.72" />
2323
<PackageReference Include="Testcontainers.PostgreSql" Version="4.8.1" />

0 commit comments

Comments
 (0)