From 3f41a04915d7ff4ffafc0660ec0cfbf9d5bd535d Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Thu, 7 Sep 2023 15:51:23 -0500 Subject: [PATCH 1/9] Adding tests and upgrading to .NET 8 preview --- .../MediatR.Examples.AspNetCore.csproj | 2 +- .../MediatR.Examples.Autofac.csproj | 2 +- .../MediatR.Examples.DryIoc.csproj | 2 +- .../MediatR.Examples.Lamar.csproj | 2 +- .../MediatR.Examples.LightInject.csproj | 2 +- .../MediatR.Examples.PublishStrategies.csproj | 2 +- .../MediatR.Examples.SimpleInjector.csproj | 2 +- .../MediatR.Examples.Stashbox.csproj | 2 +- src/MediatR/MediatR.csproj | 4 +- src/MediatR/Registration/ServiceRegistrar.cs | 1 + .../MediatR.Benchmarks.csproj | 2 +- test/MediatR.Tests/MediatR.Tests.csproj | 2 +- .../AssemblyResolutionTests.cs | 2 +- .../CustomMediatorTests.cs | 2 +- .../DuplicateAssemblyResolutionTests.cs | 2 +- .../MicrosoftExtensionsDI/Handlers.cs | 6 ++ .../MicrosoftExtensionsDI/PipelineTests.cs | 96 +++++++++++++++++++ .../TypeResolutionTests.cs | 16 +++- 18 files changed, 133 insertions(+), 16 deletions(-) diff --git a/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj b/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj index 201f9a3a..d46d9e18 100644 --- a/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj +++ b/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj @@ -10,7 +10,7 @@ - + diff --git a/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj b/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj index 6dc8561a..22900f62 100644 --- a/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj +++ b/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj b/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj index 7c234d30..9ccfecb9 100644 --- a/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj +++ b/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj @@ -11,7 +11,7 @@ - + diff --git a/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj b/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj index cd1f681b..bf1b51a9 100644 --- a/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj +++ b/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj b/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj index 5169872c..048d2e9a 100644 --- a/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj +++ b/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj b/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj index 5511431c..61f27055 100644 --- a/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj +++ b/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj @@ -6,7 +6,7 @@ - + diff --git a/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj b/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj index d5bc5856..96913b02 100644 --- a/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj +++ b/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj b/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj index bc2d1194..26890abc 100644 --- a/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj +++ b/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/MediatR/MediatR.csproj b/src/MediatR/MediatR.csproj index 37a40fd6..299d93b1 100644 --- a/src/MediatR/MediatR.csproj +++ b/src/MediatR/MediatR.csproj @@ -32,8 +32,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/MediatR/Registration/ServiceRegistrar.cs b/src/MediatR/Registration/ServiceRegistrar.cs index 0d69e158..721312eb 100644 --- a/src/MediatR/Registration/ServiceRegistrar.cs +++ b/src/MediatR/Registration/ServiceRegistrar.cs @@ -258,6 +258,7 @@ public static void AddRequiredServices(IServiceCollection services, MediatRServi private static void RegisterBehaviorIfImplementationsExist(IServiceCollection services, Type behaviorType, Type subBehaviorType) { var hasAnyRegistrationsOfSubBehaviorType = services + .Where(service => !service.IsKeyedService) .Select(service => service.ImplementationType) .OfType() .SelectMany(type => type.GetInterfaces()) diff --git a/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj b/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj index 1946994d..2f81f8dd 100644 --- a/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj +++ b/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj @@ -14,7 +14,7 @@ - + diff --git a/test/MediatR.Tests/MediatR.Tests.csproj b/test/MediatR.Tests/MediatR.Tests.csproj index a4330339..c76173c1 100644 --- a/test/MediatR.Tests/MediatR.Tests.csproj +++ b/test/MediatR.Tests/MediatR.Tests.csproj @@ -15,7 +15,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/test/MediatR.Tests/MicrosoftExtensionsDI/AssemblyResolutionTests.cs b/test/MediatR.Tests/MicrosoftExtensionsDI/AssemblyResolutionTests.cs index 83ed7998..f5175b91 100644 --- a/test/MediatR.Tests/MicrosoftExtensionsDI/AssemblyResolutionTests.cs +++ b/test/MediatR.Tests/MicrosoftExtensionsDI/AssemblyResolutionTests.cs @@ -41,7 +41,7 @@ public void ShouldResolveInternalHandler() [Fact] public void ShouldResolveNotificationHandlers() { - _provider.GetServices>().Count().ShouldBe(3); + _provider.GetServices>().Count().ShouldBe(4); } [Fact] diff --git a/test/MediatR.Tests/MicrosoftExtensionsDI/CustomMediatorTests.cs b/test/MediatR.Tests/MicrosoftExtensionsDI/CustomMediatorTests.cs index c4ce133c..65eb3276 100644 --- a/test/MediatR.Tests/MicrosoftExtensionsDI/CustomMediatorTests.cs +++ b/test/MediatR.Tests/MicrosoftExtensionsDI/CustomMediatorTests.cs @@ -39,7 +39,7 @@ public void ShouldResolveRequestHandler() [Fact] public void ShouldResolveNotificationHandlers() { - _provider.GetServices>().Count().ShouldBe(3); + _provider.GetServices>().Count().ShouldBe(4); } [Fact] diff --git a/test/MediatR.Tests/MicrosoftExtensionsDI/DuplicateAssemblyResolutionTests.cs b/test/MediatR.Tests/MicrosoftExtensionsDI/DuplicateAssemblyResolutionTests.cs index 7524c475..819b8f5d 100644 --- a/test/MediatR.Tests/MicrosoftExtensionsDI/DuplicateAssemblyResolutionTests.cs +++ b/test/MediatR.Tests/MicrosoftExtensionsDI/DuplicateAssemblyResolutionTests.cs @@ -22,6 +22,6 @@ public DuplicateAssemblyResolutionTests() [Fact] public void ShouldResolveNotificationHandlersOnlyOnce() { - _provider.GetServices>().Count().ShouldBe(3); + _provider.GetServices>().Count().ShouldBe(4); } } \ No newline at end of file diff --git a/test/MediatR.Tests/MicrosoftExtensionsDI/Handlers.cs b/test/MediatR.Tests/MicrosoftExtensionsDI/Handlers.cs index 62768991..f71c407e 100644 --- a/test/MediatR.Tests/MicrosoftExtensionsDI/Handlers.cs +++ b/test/MediatR.Tests/MicrosoftExtensionsDI/Handlers.cs @@ -78,6 +78,12 @@ public Task Handle(Pinged notification, CancellationToken cancellationToken) } } + public class PingedAlsoOpenHandler : INotificationHandler + where TNotification : Pinged + { + public Task Handle(TNotification notification, CancellationToken cancellationToken) => Task.CompletedTask; + } + public class Logger { public IList Messages { get; } = new List(); diff --git a/test/MediatR.Tests/MicrosoftExtensionsDI/PipelineTests.cs b/test/MediatR.Tests/MicrosoftExtensionsDI/PipelineTests.cs index 1d231e83..3722a378 100644 --- a/test/MediatR.Tests/MicrosoftExtensionsDI/PipelineTests.cs +++ b/test/MediatR.Tests/MicrosoftExtensionsDI/PipelineTests.cs @@ -1,5 +1,7 @@ using System.Runtime.CompilerServices; using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities; +using Xunit.Abstractions; namespace MediatR.Extensions.Microsoft.DependencyInjection.Tests; @@ -843,4 +845,98 @@ public void Should_handle_open_behaviors_registration_from_a_single_type() services.BuildServiceProvider(); }); } + + public sealed record FooRequest : IRequest; + + public interface IBlogger + { + IList Messages { get; } + } + + public class Blogger : IBlogger + { + private readonly Logger _logger; + + public Blogger(Logger logger) + { + _logger = logger; + } + + public IList Messages => _logger.Messages; + } + + public sealed class FooRequestHandler : IRequestHandler { + public FooRequestHandler(IBlogger logger) + { + this.logger = logger; + } + + readonly IBlogger logger; + + public Task Handle(FooRequest request, CancellationToken cancellationToken) { + logger.Messages.Add("Invoked Handler"); + return Task.CompletedTask; + } + } + + sealed class ClosedBehavior : IPipelineBehavior { + public ClosedBehavior(IBlogger logger) + { + this.logger = logger; + } + + readonly IBlogger logger; + + public Task Handle(FooRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) { + logger.Messages.Add("Invoked Closed Behavior"); + return next(); + } + } + + sealed class Open2Behavior : IPipelineBehavior + where TRequest : notnull { + public Open2Behavior(IBlogger> logger) { + this.logger = logger; + } + + readonly IBlogger> logger; + + public Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) { + logger.Messages.Add("Invoked Open Behavior"); + return next(); + } + } + [Fact] + public async Task Should_register_correctly() + { + var services = new ServiceCollection(); + services.AddMediatR(cfg => + { + cfg.RegisterServicesFromAssemblyContaining(); + cfg.AddBehavior(); + cfg.AddOpenBehavior(typeof(Open2Behavior<,>)); + }); + var logger = new Logger(); + services.AddSingleton(logger); + services.AddSingleton(new MediatR.Tests.PipelineTests.Logger()); + services.AddSingleton(new MediatR.Tests.StreamPipelineTests.Logger()); + services.AddSingleton(new MediatR.Tests.SendTests.Dependency()); + services.AddSingleton(new System.IO.StringWriter()); + services.AddTransient(typeof(IBlogger<>), typeof(Blogger<>)); + var provider = services.BuildServiceProvider(new ServiceProviderOptions + { + ValidateOnBuild = true + }); + + var mediator = provider.GetRequiredService(); + var request = new FooRequest(); + await mediator.Send(request); + + logger.Messages.ShouldBe(new [] + { + "Invoked Closed Behavior", + "Invoked Open Behavior", + "Invoked Handler", + }); + } } \ No newline at end of file diff --git a/test/MediatR.Tests/MicrosoftExtensionsDI/TypeResolutionTests.cs b/test/MediatR.Tests/MicrosoftExtensionsDI/TypeResolutionTests.cs index 324fa519..4438cafd 100644 --- a/test/MediatR.Tests/MicrosoftExtensionsDI/TypeResolutionTests.cs +++ b/test/MediatR.Tests/MicrosoftExtensionsDI/TypeResolutionTests.cs @@ -55,7 +55,7 @@ public void ShouldResolveVoidRequestHandler() [Fact] public void ShouldResolveNotificationHandlers() { - _provider.GetServices>().Count().ShouldBe(3); + _provider.GetServices>().Count().ShouldBe(4); } [Fact] @@ -77,4 +77,18 @@ public void ShouldResolveIgnoreSecondDuplicateHandler() { _provider.GetServices>().Count().ShouldBe(1); } + + [Fact] + public void ShouldHandleKeyedServices() + { + IServiceCollection services = new ServiceCollection(); + services.AddSingleton(new Logger()); + services.AddKeyedSingleton("Foo", "Foo"); + services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining(typeof(Ping))); + var serviceProvider = services.BuildServiceProvider(); + + var mediator = serviceProvider.GetRequiredService(); + + mediator.ShouldNotBeNull(); + } } \ No newline at end of file From 299d7ef1fd15dd8af2f768e06f3d83eb2df81880 Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Thu, 14 Sep 2023 15:19:09 -0500 Subject: [PATCH 2/9] Updating to RC1 --- .../MediatR.Examples.AspNetCore.csproj | 2 +- .../MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj | 2 +- .../MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj | 2 +- samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj | 2 +- .../MediatR.Examples.LightInject.csproj | 2 +- .../MediatR.Examples.PublishStrategies.csproj | 2 +- .../MediatR.Examples.SimpleInjector.csproj | 2 +- .../MediatR.Examples.Stashbox.csproj | 2 +- src/MediatR/MediatR.csproj | 4 ++-- test/MediatR.Benchmarks/MediatR.Benchmarks.csproj | 2 +- test/MediatR.Tests/MediatR.Tests.csproj | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj b/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj index d46d9e18..858d3557 100644 --- a/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj +++ b/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj @@ -10,7 +10,7 @@ - + diff --git a/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj b/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj index 22900f62..9f51a598 100644 --- a/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj +++ b/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj b/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj index 9ccfecb9..a4495a95 100644 --- a/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj +++ b/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj @@ -11,7 +11,7 @@ - + diff --git a/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj b/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj index bf1b51a9..6dabe8a4 100644 --- a/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj +++ b/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj b/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj index 048d2e9a..291decf1 100644 --- a/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj +++ b/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj b/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj index 61f27055..10abd8ea 100644 --- a/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj +++ b/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj @@ -6,7 +6,7 @@ - + diff --git a/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj b/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj index 96913b02..70694693 100644 --- a/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj +++ b/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj b/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj index 26890abc..33550b9a 100644 --- a/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj +++ b/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/MediatR/MediatR.csproj b/src/MediatR/MediatR.csproj index 299d93b1..88f706f7 100644 --- a/src/MediatR/MediatR.csproj +++ b/src/MediatR/MediatR.csproj @@ -32,8 +32,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj b/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj index 2f81f8dd..a725322e 100644 --- a/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj +++ b/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj @@ -14,7 +14,7 @@ - + diff --git a/test/MediatR.Tests/MediatR.Tests.csproj b/test/MediatR.Tests/MediatR.Tests.csproj index c76173c1..b7baa8fe 100644 --- a/test/MediatR.Tests/MediatR.Tests.csproj +++ b/test/MediatR.Tests/MediatR.Tests.csproj @@ -15,7 +15,7 @@ - + all runtime; build; native; contentfiles; analyzers From 82180b5b0dbeab08a3ffc2cdb8e9236307601252 Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Wed, 11 Oct 2023 10:26:47 +0200 Subject: [PATCH 3/9] Updating to RC2 --- .../MediatR.Examples.AspNetCore.csproj | 4 ++-- .../MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj | 4 ++-- .../MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj | 4 ++-- samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj | 4 ++-- .../MediatR.Examples.LightInject.csproj | 4 ++-- .../MediatR.Examples.PublishStrategies.csproj | 4 ++-- .../MediatR.Examples.SimpleInjector.csproj | 4 ++-- .../MediatR.Examples.Stashbox.csproj | 4 ++-- src/MediatR/MediatR.csproj | 2 +- test/MediatR.Benchmarks/MediatR.Benchmarks.csproj | 2 +- test/MediatR.Tests/MediatR.Tests.csproj | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj b/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj index 858d3557..a4d27f90 100644 --- a/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj +++ b/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Exe @@ -10,7 +10,7 @@ - + diff --git a/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj b/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj index 9f51a598..66aae199 100644 --- a/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj +++ b/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Exe @@ -12,7 +12,7 @@ - + diff --git a/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj b/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj index a4495a95..fa75e2ea 100644 --- a/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj +++ b/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Exe @@ -11,7 +11,7 @@ - + diff --git a/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj b/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj index 6dabe8a4..fbbf00c8 100644 --- a/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj +++ b/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj @@ -2,12 +2,12 @@ Exe - net6.0 + net8.0 - + diff --git a/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj b/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj index 291decf1..0ae43b55 100644 --- a/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj +++ b/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 Exe @@ -12,7 +12,7 @@ - + diff --git a/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj b/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj index 10abd8ea..a11f76ac 100644 --- a/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj +++ b/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj @@ -2,11 +2,11 @@ Exe - net6.0 + net8.0 - + diff --git a/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj b/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj index 70694693..bfa05696 100644 --- a/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj +++ b/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 Exe @@ -12,7 +12,7 @@ - + diff --git a/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj b/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj index 33550b9a..c011e5d2 100644 --- a/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj +++ b/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj @@ -2,12 +2,12 @@ Exe - net6.0 + net8.0 - + diff --git a/src/MediatR/MediatR.csproj b/src/MediatR/MediatR.csproj index 88f706f7..ef26290b 100644 --- a/src/MediatR/MediatR.csproj +++ b/src/MediatR/MediatR.csproj @@ -4,7 +4,7 @@ Jimmy Bogard Simple, unambitious mediator implementation in .NET Copyright Jimmy Bogard - netstandard2.0;net6.0 + netstandard2.0;net6.0;net7.0;net8.0 enable strict mediator;request;response;queries;commands;notifications diff --git a/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj b/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj index a725322e..9dd46334 100644 --- a/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj +++ b/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj @@ -14,7 +14,7 @@ - + diff --git a/test/MediatR.Tests/MediatR.Tests.csproj b/test/MediatR.Tests/MediatR.Tests.csproj index b7baa8fe..6e541fca 100644 --- a/test/MediatR.Tests/MediatR.Tests.csproj +++ b/test/MediatR.Tests/MediatR.Tests.csproj @@ -15,7 +15,7 @@ - + all runtime; build; native; contentfiles; analyzers From d4baf33d87983322a59ffb16a35e1b61efed76cf Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Wed, 11 Oct 2023 10:45:04 +0200 Subject: [PATCH 4/9] Updating to RC2 --- src/MediatR/MediatR.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MediatR/MediatR.csproj b/src/MediatR/MediatR.csproj index ef26290b..889dc76e 100644 --- a/src/MediatR/MediatR.csproj +++ b/src/MediatR/MediatR.csproj @@ -32,8 +32,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From b9711422d2d9cb5784f8047707d3ec094e84b1a2 Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Wed, 25 Oct 2023 11:45:53 -0500 Subject: [PATCH 5/9] Using .NET 8 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc2146b9..7a8aae3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,10 +15,10 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Setup dotnet 6.0 + - name: Setup dotnet 8.0 uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Build and Test run: ./Build.ps1 shell: pwsh From aeb34fb649db6435a89505f33c6d6945494f54c0 Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Wed, 25 Oct 2023 11:48:34 -0500 Subject: [PATCH 6/9] Trying again --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a8aae3f..6c18de24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Setup dotnet 8.0 uses: actions/setup-dotnet@v1 with: - dotnet-version: '8.0.x' + dotnet-version: '8.0.100-rc.2' - name: Build and Test run: ./Build.ps1 shell: pwsh From ffa88f051aa07ff365d2ed5338975607e583019c Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Wed, 25 Oct 2023 11:50:43 -0500 Subject: [PATCH 7/9] Trying again again --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c18de24..4c580a1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Setup dotnet 8.0 uses: actions/setup-dotnet@v1 with: - dotnet-version: '8.0.100-rc.2' + dotnet-version: '8.0.100-rc.2.23502.2' - name: Build and Test run: ./Build.ps1 shell: pwsh From 772ecc188a82edd59fb26121e3d3124df29e3d3f Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Wed, 25 Oct 2023 12:37:22 -0500 Subject: [PATCH 8/9] Yet again again --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c580a1d..3c25c7fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,10 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + - name: Setup dotnet 6.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0.x' - name: Setup dotnet 8.0 uses: actions/setup-dotnet@v1 with: From fcb6f96813b12c2b7ecf5ce9f7c5c3a87ef984bf Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Thu, 16 Nov 2023 13:24:42 +0100 Subject: [PATCH 9/9] Updating to RTM --- .../MediatR.Examples.AspNetCore.csproj | 2 +- .../MediatR.Examples.Autofac.csproj | 4 ++-- .../MediatR.Examples.DryIoc.csproj | 4 ++-- .../MediatR.Examples.Lamar.csproj | 5 +++-- .../MediatR.Examples.LightInject.csproj | 6 +++--- .../MediatR.Examples.PublishStrategies.csproj | 2 +- .../MediatR.Examples.SimpleInjector.csproj | 6 +++--- .../MediatR.Examples.Stashbox.csproj | 4 ++-- src/MediatR.Contracts/MediatR.Contracts.csproj | 2 +- src/MediatR/MediatR.csproj | 8 ++++---- test/MediatR.Benchmarks/MediatR.Benchmarks.csproj | 6 +++--- test/MediatR.Tests/MediatR.Tests.csproj | 15 ++++++++------- 12 files changed, 33 insertions(+), 31 deletions(-) diff --git a/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj b/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj index a4d27f90..c257e315 100644 --- a/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj +++ b/samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj @@ -10,7 +10,7 @@ - + diff --git a/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj b/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj index 66aae199..f9f44666 100644 --- a/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj +++ b/samples/MediatR.Examples.Autofac/MediatR.Examples.Autofac.csproj @@ -10,9 +10,9 @@ - + - + diff --git a/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj b/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj index fa75e2ea..cd9a913a 100644 --- a/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj +++ b/samples/MediatR.Examples.DryIoc/MediatR.Examples.DryIoc.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj b/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj index fbbf00c8..b312a237 100644 --- a/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj +++ b/samples/MediatR.Examples.Lamar/MediatR.Examples.Lamar.csproj @@ -6,8 +6,9 @@ - - + + + diff --git a/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj b/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj index 0ae43b55..b6a051d4 100644 --- a/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj +++ b/samples/MediatR.Examples.LightInject/MediatR.Examples.LightInject.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj b/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj index a11f76ac..4e3cf954 100644 --- a/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj +++ b/samples/MediatR.Examples.PublishStrategies/MediatR.Examples.PublishStrategies.csproj @@ -6,7 +6,7 @@ - + diff --git a/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj b/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj index bfa05696..a9f2a713 100644 --- a/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj +++ b/samples/MediatR.Examples.SimpleInjector/MediatR.Examples.SimpleInjector.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj b/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj index c011e5d2..5c9a569f 100644 --- a/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj +++ b/samples/MediatR.Examples.Stashbox/MediatR.Examples.Stashbox.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/src/MediatR.Contracts/MediatR.Contracts.csproj b/src/MediatR.Contracts/MediatR.Contracts.csproj index c15f9c30..a311f618 100644 --- a/src/MediatR.Contracts/MediatR.Contracts.csproj +++ b/src/MediatR.Contracts/MediatR.Contracts.csproj @@ -29,7 +29,7 @@ - + diff --git a/src/MediatR/MediatR.csproj b/src/MediatR/MediatR.csproj index 889dc76e..44270629 100644 --- a/src/MediatR/MediatR.csproj +++ b/src/MediatR/MediatR.csproj @@ -4,7 +4,7 @@ Jimmy Bogard Simple, unambitious mediator implementation in .NET Copyright Jimmy Bogard - netstandard2.0;net6.0;net7.0;net8.0 + netstandard2.0;net6.0 enable strict mediator;request;response;queries;commands;notifications @@ -32,9 +32,9 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + diff --git a/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj b/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj index 9dd46334..1d88a19c 100644 --- a/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj +++ b/test/MediatR.Benchmarks/MediatR.Benchmarks.csproj @@ -12,9 +12,9 @@ Release - - - + + + diff --git a/test/MediatR.Tests/MediatR.Tests.csproj b/test/MediatR.Tests/MediatR.Tests.csproj index 6e541fca..cff87cca 100644 --- a/test/MediatR.Tests/MediatR.Tests.csproj +++ b/test/MediatR.Tests/MediatR.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 enable @@ -10,13 +10,14 @@ - - - - + + + + - - + + + all runtime; build; native; contentfiles; analyzers