Skip to content

Commit

Permalink
Merge pull request #123 from netcorepal/update-pomelo-mysql
Browse files Browse the repository at this point in the history
update Pomelo.EntityFrameworkCore.MySql to support dotnet9
  • Loading branch information
witskeeper authored Dec 13, 2024
2 parents 9b1f7d0 + 701c1dc commit b4e54ae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ExtensionsVersion>9.0.0</ExtensionsVersion>
<EntityFrameworkVersion>9.0.0</EntityFrameworkVersion>
<NpgsqlEntityFrameworkCorePostgreSQLVersion>9.0.1</NpgsqlEntityFrameworkCorePostgreSQLVersion>
<PomeloVersion>9.0.0-preview.1</PomeloVersion>
<PomeloVersion>9.0.0-preview.2.efcore.9.0.0</PomeloVersion>
</PropertyGroup>
<ItemGroup>
<!--microsoft extensions -->
Expand Down
8 changes: 4 additions & 4 deletions test/NetCorePal.Web.UnitTests/MyWebApplicationFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class MyWebApplicationFactory : WebApplicationFactory<Program>, IAsyncLif
// private readonly PostgreSqlContainer postgreSqlContainer = new PostgreSqlBuilder()
// .WithUsername("postgres").WithPassword("123456")
// .WithDatabase("demo").Build();
#if NET9_0
#if NET10_0
private readonly PostgreSqlContainer pgSqlContainer = new PostgreSqlBuilder().Build();
#else
private readonly MySqlContainer mySqlContainer = new MySqlBuilder()
Expand All @@ -30,7 +30,7 @@ public class MyWebApplicationFactory : WebApplicationFactory<Program>, IAsyncLif

protected override void ConfigureWebHost(IWebHostBuilder builder)
{
#if NET9_0
#if NET10_0
builder.UseSetting("ConnectionStrings:PostgreSql", pgSqlContainer.GetConnectionString());
#else
builder.UseSetting("ConnectionStrings:MySql", mySqlContainer.GetConnectionString());
Expand All @@ -49,7 +49,7 @@ public Task InitializeAsync()
{
return Task.WhenAll(redisContainer.StartAsync(),
rabbitMqContainer.StartAsync(),
#if NET9_0
#if NET10_0
pgSqlContainer.StartAsync());
#else
mySqlContainer.StartAsync());
Expand All @@ -60,7 +60,7 @@ public Task InitializeAsync()
{
return Task.WhenAll(redisContainer.StopAsync(),
rabbitMqContainer.StopAsync(),
#if NET9_0
#if NET10_0
pgSqlContainer.StopAsync());
#else
mySqlContainer.StopAsync());
Expand Down
4 changes: 2 additions & 2 deletions test/NetCorePal.Web/NetCorePal.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net9.0'">
<ItemGroup Condition="'$(TargetFramework)' != 'net10.0'">
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" />
<ProjectReference Include="..\..\src\DistributedTransactions.CAP.MySql\NetCorePal.Extensions.DistributedTransactions.CAP.MySql.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" />
<ProjectReference Include="..\..\src\DistributedTransactions.CAP.PostgreSql\NetCorePal.Extensions.DistributedTransactions.CAP.PostgreSql.csproj" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions test/NetCorePal.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
builder.Services.AddRepositories(typeof(ApplicationDbContext).Assembly);
builder.Services.AddDbContext<ApplicationDbContext>(options =>
{
#if NET9_0
#if NET10_0
options.UseNpgsql(builder.Configuration.GetConnectionString("PostgreSql"));
#else
options.UseMySql(builder.Configuration.GetConnectionString("Mysql"),
Expand All @@ -170,7 +170,7 @@
});

builder.Services.AddUnitOfWork<ApplicationDbContext>();
#if NET9_0
#if NET10_0
builder.Services.AddPostgreSqlTransactionHandler();
#else
//builder.Services.AddPostgreSqlTransactionHandler();
Expand Down

0 comments on commit b4e54ae

Please sign in to comment.