diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml
index e1e85d2..c7918fb 100644
--- a/.github/workflows/build-release.yml
+++ b/.github/workflows/build-release.yml
@@ -24,7 +24,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
- dotnet-version: '9.x'
+ dotnet-version: '10.x'
- name: Install Coverlet
run: dotnet tool install --global coverlet.console
diff --git a/Directory.Packages.props b/Directory.Packages.props
new file mode 100644
index 0000000..02f54c3
--- /dev/null
+++ b/Directory.Packages.props
@@ -0,0 +1,25 @@
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DispatchR.sln b/DispatchR.sln
index d08ec5b..1c069ef 100644
--- a/DispatchR.sln
+++ b/DispatchR.sln
@@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
.gitignore = .gitignore
CHANGELOG.md = CHANGELOG.md
+ Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{0C407C1E-9E95-40A5-ABCA-52AACCC49C96}"
diff --git a/src/AspireModularExample/AspireModularSample.AppHost/AspireModularSample.AppHost.csproj b/src/AspireModularExample/AspireModularSample.AppHost/AspireModularSample.AppHost.csproj
index ba54d1e..9841e6d 100644
--- a/src/AspireModularExample/AspireModularSample.AppHost/AspireModularSample.AppHost.csproj
+++ b/src/AspireModularExample/AspireModularSample.AppHost/AspireModularSample.AppHost.csproj
@@ -4,7 +4,7 @@
Exe
- net9.0
+ net10.0
enable
enable
true
@@ -12,7 +12,7 @@
-
+
diff --git a/src/AspireModularExample/AspireModularSample.Modules/AspireModularSample.Modules.csproj b/src/AspireModularExample/AspireModularSample.Modules/AspireModularSample.Modules.csproj
index 111bf03..36e7c50 100644
--- a/src/AspireModularExample/AspireModularSample.Modules/AspireModularSample.Modules.csproj
+++ b/src/AspireModularExample/AspireModularSample.Modules/AspireModularSample.Modules.csproj
@@ -1,7 +1,7 @@
- net9.0
+ net10.0
enable
enable
diff --git a/src/AspireModularExample/AspireModularSample.ServiceA/AspireModularSample.ServiceA.csproj b/src/AspireModularExample/AspireModularSample.ServiceA/AspireModularSample.ServiceA.csproj
index a64b164..813f57d 100644
--- a/src/AspireModularExample/AspireModularSample.ServiceA/AspireModularSample.ServiceA.csproj
+++ b/src/AspireModularExample/AspireModularSample.ServiceA/AspireModularSample.ServiceA.csproj
@@ -6,11 +6,11 @@
-
+
- net9.0
+ net10.0
enable
enable
diff --git a/src/AspireModularExample/AspireModularSample.ServiceB/AspireModularSample.ServiceB.csproj b/src/AspireModularExample/AspireModularSample.ServiceB/AspireModularSample.ServiceB.csproj
index a64b164..813f57d 100644
--- a/src/AspireModularExample/AspireModularSample.ServiceB/AspireModularSample.ServiceB.csproj
+++ b/src/AspireModularExample/AspireModularSample.ServiceB/AspireModularSample.ServiceB.csproj
@@ -6,11 +6,11 @@
-
+
- net9.0
+ net10.0
enable
enable
diff --git a/src/Benchmark/Benchmark.csproj b/src/Benchmark/Benchmark.csproj
index 8524f39..3e29984 100644
--- a/src/Benchmark/Benchmark.csproj
+++ b/src/Benchmark/Benchmark.csproj
@@ -1,24 +1,24 @@
- net9.0
+ net10.0
enable
true
enable
-
+
-
+
-
-
+
+
all
runtime; build; native; contentfiles; analyzers
diff --git a/src/Benchmark/Notification/NotificationBenchmarks.cs b/src/Benchmark/Notification/NotificationBenchmarks.cs
index c429d8d..77f51d1 100644
--- a/src/Benchmark/Notification/NotificationBenchmarks.cs
+++ b/src/Benchmark/Notification/NotificationBenchmarks.cs
@@ -3,7 +3,6 @@
using Benchmark.Notification.SingleHandler;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Order;
-using DispatchR;
using DispatchR.Extensions;
namespace Benchmark.Notification;
@@ -43,6 +42,7 @@ public enum ScenarioType
public void Setup()
{
var services = new ServiceCollection();
+ services.AddLogging();
services.AddMediator(opts =>
{
opts.ServiceLifetime = ServiceLifetime.Scoped;
diff --git a/src/Benchmark/SendRequest/MediatRVsDispatchRBenchmark.cs b/src/Benchmark/SendRequest/MediatRVsDispatchRBenchmark.cs
index 128d313..62ad5b6 100644
--- a/src/Benchmark/SendRequest/MediatRVsDispatchRBenchmark.cs
+++ b/src/Benchmark/SendRequest/MediatRVsDispatchRBenchmark.cs
@@ -31,6 +31,7 @@ public class MediatRVsDispatchBenchmark
public void Setup()
{
var withoutPipelineServices = new ServiceCollection();
+ withoutPipelineServices.AddLogging();
withoutPipelineServices.AddMediatR(cfg =>
{
cfg.Lifetime = ServiceLifetime.Scoped;
diff --git a/src/Benchmark/SendRequest/MediatRVsDispatchRWithPipelineBenchmark.cs b/src/Benchmark/SendRequest/MediatRVsDispatchRWithPipelineBenchmark.cs
index 31c3f05..bf1f07f 100644
--- a/src/Benchmark/SendRequest/MediatRVsDispatchRWithPipelineBenchmark.cs
+++ b/src/Benchmark/SendRequest/MediatRVsDispatchRWithPipelineBenchmark.cs
@@ -32,7 +32,7 @@ public class MediatRVsDispatchWithPipelineRBenchmark
public void Setup()
{
var withPipelineServices = new ServiceCollection();
-
+ withPipelineServices.AddLogging();
withPipelineServices.AddMediatR(cfg =>
{
cfg.Lifetime = ServiceLifetime.Scoped;
diff --git a/src/Benchmark/StreamRequest/StreamMediatRVsDispatchRBenchmark.cs b/src/Benchmark/StreamRequest/StreamMediatRVsDispatchRBenchmark.cs
index 3fe039e..c885fb9 100644
--- a/src/Benchmark/StreamRequest/StreamMediatRVsDispatchRBenchmark.cs
+++ b/src/Benchmark/StreamRequest/StreamMediatRVsDispatchRBenchmark.cs
@@ -31,6 +31,7 @@ public class StreamMediatRVsDispatchBenchmark
public void Setup()
{
var withoutPipelineServices = new ServiceCollection();
+ withoutPipelineServices.AddLogging();
withoutPipelineServices.AddMediatR(cfg =>
{
cfg.Lifetime = ServiceLifetime.Scoped;
diff --git a/src/Benchmark/StreamRequest/StreamMediatRVsDispatchRWithPipelineBenchmark.cs b/src/Benchmark/StreamRequest/StreamMediatRVsDispatchRWithPipelineBenchmark.cs
index 8d01f8b..a92ee73 100644
--- a/src/Benchmark/StreamRequest/StreamMediatRVsDispatchRWithPipelineBenchmark.cs
+++ b/src/Benchmark/StreamRequest/StreamMediatRVsDispatchRWithPipelineBenchmark.cs
@@ -32,7 +32,7 @@ public class StreamMediatRVsDispatchWithPipelineRBenchmark
public void Setup()
{
var withPipelineServices = new ServiceCollection();
-
+ withPipelineServices.AddLogging();
withPipelineServices.AddMediatR(cfg =>
{
cfg.Lifetime = ServiceLifetime.Scoped;
diff --git a/src/Benchmark/StreamRequest/StreamMediatSGCommands.cs b/src/Benchmark/StreamRequest/StreamMediatSGCommands.cs
index f7e411a..231bf45 100644
--- a/src/Benchmark/StreamRequest/StreamMediatSGCommands.cs
+++ b/src/Benchmark/StreamRequest/StreamMediatSGCommands.cs
@@ -17,8 +17,7 @@ public async IAsyncEnumerable Handle(PingStreamMediatSg request, [Enumerato
public sealed class LoggingBehaviorMediatSg : IStreamPipelineBehavior
{
- // version 2.x
- public async IAsyncEnumerable Handle(PingStreamMediatSg message, [EnumeratorCancellation] CancellationToken cancellationToken, StreamHandlerDelegate next)
+ public async IAsyncEnumerable Handle(PingStreamMediatSg message, StreamHandlerDelegate next, [EnumeratorCancellation] CancellationToken cancellationToken)
{
await foreach (var response in next(message, cancellationToken).ConfigureAwait(false))
{
diff --git a/src/DispatchR.Abstractions/DispatchR.Abstractions.csproj b/src/DispatchR.Abstractions/DispatchR.Abstractions.csproj
index bc5afdb..9ec8a09 100644
--- a/src/DispatchR.Abstractions/DispatchR.Abstractions.csproj
+++ b/src/DispatchR.Abstractions/DispatchR.Abstractions.csproj
@@ -1,7 +1,7 @@
- net9.0;net8.0;
+ net8.0;net9.0;net10.0
enable
enable
icon-mini.png
diff --git a/src/DispatchR/DispatchR.csproj b/src/DispatchR/DispatchR.csproj
index 03be037..7d55aef 100644
--- a/src/DispatchR/DispatchR.csproj
+++ b/src/DispatchR/DispatchR.csproj
@@ -1,6 +1,6 @@
-
+
- net8.0;net9.0
+ net8.0;net9.0;net10.0
enable
enable
README.md
@@ -15,12 +15,7 @@
https://github.com/hasanxdev/DispatchR
-
-
+
diff --git a/src/Sample/DispatchR/StreamRequest/GenericPipelineBehavior.cs b/src/Sample/DispatchR/StreamRequest/GenericPipelineBehavior.cs
index 0378708..984865f 100644
--- a/src/Sample/DispatchR/StreamRequest/GenericPipelineBehavior.cs
+++ b/src/Sample/DispatchR/StreamRequest/GenericPipelineBehavior.cs
@@ -1,4 +1,5 @@
-using DispatchR.Abstractions.Stream;
+using System.Runtime.CompilerServices;
+using DispatchR.Abstractions.Stream;
namespace Sample.DispatchR.StreamRequest;
@@ -6,7 +7,7 @@ public class GenericPipelineBehavior(ILogger
where TRequest : class, IStreamRequest
{
- public async IAsyncEnumerable Handle(TRequest request, CancellationToken cancellationToken)
+ public async IAsyncEnumerable Handle(TRequest request, [EnumeratorCancellation] CancellationToken cancellationToken)
{
logger.LogInformation("Generic Request Pipeline");
await foreach (var response in NextPipeline.Handle(request, cancellationToken).ConfigureAwait(false))
diff --git a/src/Sample/Sample.csproj b/src/Sample/Sample.csproj
index 46fab57..ab2eb62 100644
--- a/src/Sample/Sample.csproj
+++ b/src/Sample/Sample.csproj
@@ -1,15 +1,15 @@
-
+
- net9.0
+ net10.0
enable
enable
-
-
-
+
+
+
diff --git a/tests/DispatchR.IntegrationTest/DispatchR.IntegrationTest.csproj b/tests/DispatchR.IntegrationTest/DispatchR.IntegrationTest.csproj
index 4594ed9..69e3ded 100644
--- a/tests/DispatchR.IntegrationTest/DispatchR.IntegrationTest.csproj
+++ b/tests/DispatchR.IntegrationTest/DispatchR.IntegrationTest.csproj
@@ -1,30 +1,33 @@
-
+
- net9.0
+ net10.0
enable
enable
false
-
-
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
-
+
diff --git a/tests/DispatchR.TestCommon/DispatchR.TestCommon.csproj b/tests/DispatchR.TestCommon/DispatchR.TestCommon.csproj
index 8e1adc7..78ab4eb 100644
--- a/tests/DispatchR.TestCommon/DispatchR.TestCommon.csproj
+++ b/tests/DispatchR.TestCommon/DispatchR.TestCommon.csproj
@@ -1,7 +1,7 @@
- net9.0
+ net10.0
enable
enable
diff --git a/tests/DispatchR.TestCommon/Fixtures/StreamRequest/GenericPipelineBehavior.cs b/tests/DispatchR.TestCommon/Fixtures/StreamRequest/GenericPipelineBehavior.cs
index 7a0b041..0292a43 100644
--- a/tests/DispatchR.TestCommon/Fixtures/StreamRequest/GenericPipelineBehavior.cs
+++ b/tests/DispatchR.TestCommon/Fixtures/StreamRequest/GenericPipelineBehavior.cs
@@ -1,3 +1,4 @@
+using System.Runtime.CompilerServices;
using DispatchR.Abstractions.Stream;
namespace DispatchR.TestCommon.Fixtures.StreamRequest;
@@ -6,7 +7,7 @@ public class GenericPipelineBehavior()
: IStreamPipelineBehavior
where TRequest : class, IStreamRequest, new()
{
- public async IAsyncEnumerable Handle(TRequest request, CancellationToken cancellationToken)
+ public async IAsyncEnumerable Handle(TRequest request, [EnumeratorCancellation] CancellationToken cancellationToken)
{
await foreach (var response in NextPipeline.Handle(request, cancellationToken).ConfigureAwait(false))
{
diff --git a/tests/DispatchR.UnitTest/DispatchR.UnitTest.csproj b/tests/DispatchR.UnitTest/DispatchR.UnitTest.csproj
index 69524d7..f758a31 100644
--- a/tests/DispatchR.UnitTest/DispatchR.UnitTest.csproj
+++ b/tests/DispatchR.UnitTest/DispatchR.UnitTest.csproj
@@ -1,33 +1,33 @@
- net9.0
+ net10.0
enable
enable
false
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
+
-
+