Skip to content

Commit

Permalink
add tfm net8.0;
Browse files Browse the repository at this point in the history
  • Loading branch information
stratosblue committed Nov 15, 2023
1 parent 2ef57b2 commit cb149c2
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/PublishNugetPackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'
- name: restore dependencies
run: dotnet restore
- name: build
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>

<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>

<Version>1.0.0-preview-005</Version>
<Version>1.0.0-preview-006</Version>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions src/FluentWorkflow.Core/Exceptions/WorkflowException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public WorkflowException(string message, Exception inner) : base(message, inner)
#region Protected 构造函数

/// <inheritdoc cref="WorkflowException"/>
[Obsolete("see https://github.com/dotnet/docs/issues/34893")]
protected WorkflowException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public WorkflowInvalidOperationException(string message, Exception inner) : base
#region Protected 构造函数

/// <inheritdoc cref="WorkflowInvalidOperationException"/>
[Obsolete("see https://github.com/dotnet/docs/issues/34893")]
protected WorkflowInvalidOperationException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
Expand Down
6 changes: 3 additions & 3 deletions src/FluentWorkflow.Core/FluentWorkflow.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ public InMemoryWorkflowMessageDispatcher(IServiceScopeFactory serviceScopeFactor
WorkflowBuildStateCollection workflowBuildStates,
ILogger<InMemoryWorkflowMessageDispatcher> logger)
{
if (workflowBuildStates is null)
{
throw new ArgumentNullException(nameof(workflowBuildStates));
}
ArgumentNullException.ThrowIfNull(workflowBuildStates);

_serviceScopeFactory = serviceScopeFactory ?? throw new ArgumentNullException(nameof(serviceScopeFactory));
_eventSubscribeDescriptors = workflowBuildStates.SelectMany(m => m)
Expand All @@ -48,10 +45,7 @@ public InMemoryWorkflowMessageDispatcher(IServiceScopeFactory serviceScopeFactor
/// <inheritdoc/>
Task IWorkflowMessageDispatcher.PublishAsync<TMessage>(TMessage message, CancellationToken cancellationToken)
{
if (message is null)
{
throw new ArgumentNullException(nameof(message));
}
ArgumentNullException.ThrowIfNull(message);

if (!_eventSubscribeDescriptors.TryGetValue(TMessage.EventName, out var invokerDescriptors))
{
Expand Down
5 changes: 1 addition & 4 deletions src/FluentWorkflow.Core/TracingContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ public readonly struct TracingContext
/// <inheritdoc cref="TracingContext"/>
public TracingContext(Activity activity)
{
if (activity is null)
{
throw new ArgumentNullException(nameof(activity));
}
ArgumentNullException.ThrowIfNull(activity);

var context = activity.Context;
TraceId = context.TraceId.ToHexString();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0</TargetFrameworks>

<IncludeBuildOutput>false</IncludeBuildOutput>

Expand Down
4 changes: 2 additions & 2 deletions src/FluentWorkflow.RabbitMQ/FluentWorkflow.RabbitMQ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageReference Include="RabbitMQ.Client" Version="6.5.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="RabbitMQ.Client" Version="6.6.0" />

<Using Include="FluentWorkflow.RabbitMQ.Tracing" Static="true" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public override async Task CleanupProviderAsync()
var options = ServiceProvider.GetRequiredService<IOptions<RabbitMQOptions>>();
var connectionProvider = ServiceProvider.GetRequiredService<IRabbitMQConnectionProvider>();
using var connection = await connectionProvider.GetAsync(default);
connection.CreateModel().QueueDeleteNoWait(options.Value.ConsumeQueueName, false, false);
using var model = connection.CreateModel();
model.QueueDeleteNoWait(options.Value.ConsumeQueueName, false, false);
await base.CleanupProviderAsync();
}

Expand All @@ -47,6 +48,7 @@ protected override void ConfigureServices(HostBuilderContext context, IServiceCo
services.AddFluentWorkflow()
.UseRabbitMQMessageDispatcher(options =>
{
options.ExchangeName = $"fwf-test-exchange-{Environment.Version.Major}_{Environment.Version.Minor}";
options.ConsumeQueueName = $"RabbitMQTestQueue-{DateTime.Now:yyyy:MM:dd:HH.mm.ss.ffff}";
options.Uri = new Uri(context.Configuration.GetRequiredSection("RabbitMQ").Value!);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public override async Task CleanupProviderAsync()
var options = ServiceProvider.GetRequiredService<IOptions<RabbitMQOptions>>();
var connectionProvider = ServiceProvider.GetRequiredService<IRabbitMQConnectionProvider>();
using var connection = await connectionProvider.GetAsync(default);
connection.CreateModel().QueueDeleteNoWait(options.Value.ConsumeQueueName, false, false);
using var model = connection.CreateModel();
model.QueueDeleteNoWait(options.Value.ConsumeQueueName, false, false);
await base.CleanupProviderAsync();
_activityListener?.Dispose();
_activityListener = null;
Expand All @@ -64,6 +65,7 @@ protected override void ConfigureServices(HostBuilderContext context, IServiceCo
services.AddFluentWorkflow()
.UseRabbitMQMessageDispatcher(options =>
{
options.ExchangeName = $"fwf-test-exchange-{Environment.Version.Major}_{Environment.Version.Minor}";
options.ConsumeQueueName = $"RabbitMQTestQueue-{DateTime.Now:yyyy:MM:dd:HH.mm.ss.ffff}";
options.Uri = new Uri(context.Configuration.GetRequiredSection("RabbitMQ").Value!);
});
Expand Down

0 comments on commit cb149c2

Please sign in to comment.