Skip to content

Commit 7eec04f

Browse files
committed
Update dependencies and refactor for .NET 8 support
- Added `System.Data.Common` using directive in `AppDbContext.cs`. - Modified `CapNpgsqlRelationalConnection` constructor to use `DbDataSource`. - Added pragma warning for internal EF Core API usage. - Updated `Npgsql.EntityFrameworkCore.PostgreSQL` to version `9.0.4`. - Introduced new subscriber method `Subscriber2` in `ValuesController.cs`. - Updated `Microsoft.AspNetCore.Authentication.JwtBearer` to `8.0.7`. - Updated `Microsoft.EntityFrameworkCore.SqlServer` to `8.0.18`. - Changed target framework to `net8.0` across multiple projects. - Updated `Microsoft.EntityFrameworkCore.Relational` to `8.0.18`. - Updated `Microsoft.Data.SqlClient` to `6.1.0`. - Updated `KubernetesClient` to `17.0.4`. - Refactored `DiagnosticListener` for improved null checks and exception handling. - Removed multi-targeting in `DotNetCore.CAP.Pulsar.csproj`, now targets only `net8.0`. - Updated `DotNetCore.CAP.csproj` to target `net8.0` and `net9.0`, with package references updated to `9.0.7`.
1 parent 338bbcb commit 7eec04f

File tree

22 files changed

+78
-79
lines changed

22 files changed

+78
-79
lines changed

samples/Sample.Kafka.PostgreSql/AppDbContext.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Microsoft.Extensions.DependencyInjection;
88
using Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal;
99
using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal;
10+
using System.Data.Common;
1011

1112
namespace Sample.Kafka.PostgreSql
1213
{
@@ -34,16 +35,19 @@ public AppDbContext(DbContextOptions<AppDbContext> options)
3435
public DbSet<Person> Persons { get; set; }
3536
}
3637

38+
#pragma warning disable EF1001 // Internal EF Core API usage.
39+
3740
public class CapNpgsqlRelationalConnection : NpgsqlRelationalConnection
3841
{
3942
private readonly ICapPublisher _cap;
4043

41-
public CapNpgsqlRelationalConnection(RelationalConnectionDependencies dependencies, INpgsqlSingletonOptions options)
42-
: base(dependencies, options)
44+
protected CapNpgsqlRelationalConnection(RelationalConnectionDependencies dependencies, DbDataSource dataSource) : base(dependencies, dataSource)
4345
{
4446
_cap = dependencies.CurrentContext.Context.GetService<ICapPublisher>();
4547
}
4648

49+
#pragma warning restore EF1001
50+
4751
public override void CommitTransaction()
4852
{
4953
if (_cap.Transaction != null)

samples/Sample.Kafka.PostgreSql/Sample.Kafka.PostgreSql.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<ItemGroup>
1010
<PackageReference Include="Dapper" Version="2.1.66" />
11-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.11" />
11+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
1212
</ItemGroup>
1313
<ItemGroup>
1414
<ProjectReference Include="..\..\src\DotNetCore.CAP.Dashboard\DotNetCore.CAP.Dashboard.csproj" />

samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,13 @@ public void Subscriber(DateTime time)
8181
{
8282
Console.WriteLine("Publishing time:" + time);
8383
}
84+
85+
86+
[NonAction]
87+
[CapSubscribe("sample.rabbitmq.test")]
88+
public void Subscriber2(string message)
89+
{
90+
Console.WriteLine("Publishing message:" + message);
91+
}
8492
}
8593
}

samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<ItemGroup>
88
<PackageReference Include="Dapper" Version="2.1.66" />
9-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
9+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.7" />
1010
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.3" />
1111
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.3" />
1212
</ItemGroup>

samples/Sample.RabbitMQ.SqlServer/Sample.RabbitMQ.SqlServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<ItemGroup>
88
<PackageReference Include="Dapper" Version="2.1.66" />
9-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.11" />
9+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.18" />
1010
<PackageReference Include="NameGenerator" Version="2.0.4" />
1111
</ItemGroup>
1212

src/DotNetCore.CAP.AmazonSQS/DotNetCore.CAP.AmazonSQS.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<PackageTags>$(PackageTags);AmazonSQS;SQS</PackageTags>
77
</PropertyGroup>

src/DotNetCore.CAP.AzureServiceBus/DotNetCore.CAP.AzureServiceBus.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<PackageTags>$(PackageTags);AzureServiceBus</PackageTags>
77
</PropertyGroup>

src/DotNetCore.CAP.Dashboard.K8s/DotNetCore.CAP.Dashboard.K8s.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net6.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="KubernetesClient" Version="15.0.1" />
8+
<PackageReference Include="KubernetesClient" Version="17.0.4" />
99
</ItemGroup>
1010
<ItemGroup>
1111
<ProjectReference Include="..\DotNetCore.CAP.Dashboard\DotNetCore.CAP.Dashboard.csproj" />

src/DotNetCore.CAP.Dashboard/DotNetCore.CAP.Dashboard.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<LangVersion>default</LangVersion>
66
<Nullable>disable</Nullable>
77
</PropertyGroup>

src/DotNetCore.CAP.InMemoryStorage/DotNetCore.CAP.InMemoryStorage.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<PackageTags>$(PackageTags);InMemory</PackageTags>
77
</PropertyGroup>

0 commit comments

Comments
 (0)