Skip to content

Commit 75a47e9

Browse files
Update README, snapshots after version bump (#221)
1 parent 428e3b4 commit 75a47e9

File tree

88 files changed

+1334
-1340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1334
-1340
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ jobs:
206206
dotnet pack src/Mediator/Mediator.csproj --no-restore --no-build --verbosity normal -c Release -o artifacts/ && \
207207
dotnet pack src/Mediator.SourceGenerator/Mediator.SourceGenerator.csproj --no-restore --no-build --verbosity normal -c Release -o artifacts/
208208
209-
- name: Push to NuGet
210-
if: ${{ success() && github.event_name != 'pull_request' }}
211-
run: dotnet nuget push artifacts/**.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}
209+
# No previews yet
210+
# - name: Push to NuGet
211+
# if: ${{ success() && github.event_name != 'pull_request' }}
212+
# run: dotnet nuget push artifacts/**.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}

README.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88

99
# Mediator
1010

11-
> **Note**
12-
>
13-
> **Version 3.0** is currently being finalized. It is recommended to start using v3 prereleases as opposed to v2.1. See status and provide feedback [here (#98)](https://github.com/martinothamar/Mediator/issues/98)
14-
1511
This is a high performance .NET implementation of the Mediator pattern using the [source generators](https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/) feature introduced in .NET 5.
1612
The API and usage is mostly based on the great [MediatR](https://github.com/jbogard/MediatR) library, with some deviations to allow for better performance.
1713
Packages are .NET Standard 2.0 compatible.
@@ -36,16 +32,16 @@ In particular, source generators in this library is used to
3632
NuGet packages:
3733

3834
```pwsh
39-
dotnet add package Mediator.SourceGenerator --version 3.0.*-*
40-
dotnet add package Mediator.Abstractions --version 3.0.*-*
35+
dotnet add package Mediator.SourceGenerator --version 3.0.*
36+
dotnet add package Mediator.Abstractions --version 3.0.*
4137
```
4238
or
4339
```xml
44-
<PackageReference Include="Mediator.SourceGenerator" Version="3.0.*-*">
40+
<PackageReference Include="Mediator.SourceGenerator" Version="3.0.*">
4541
<PrivateAssets>all</PrivateAssets>
4642
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4743
</PackageReference>
48-
<PackageReference Include="Mediator.Abstractions" Version="3.0.*-*" />
44+
<PackageReference Include="Mediator.Abstractions" Version="3.0.*" />
4945
```
5046

5147
See this great video by [@Elfocrash / Nick Chapsas](https://github.com/Elfocrash), covering both similarities and differences between Mediator and MediatR
@@ -310,16 +306,16 @@ See the full runnable sample code in the [Showcase sample](/samples/Showcase/).
310306
### 4.1. Add packages
311307

312308
```pwsh
313-
dotnet add package Mediator.SourceGenerator --version 3.0.*-*
314-
dotnet add package Mediator.Abstractions --version 3.0.*-*
309+
dotnet add package Mediator.SourceGenerator --version 3.0.*
310+
dotnet add package Mediator.Abstractions --version 3.0.*
315311
```
316312
or
317313
```xml
318-
<PackageReference Include="Mediator.SourceGenerator" Version="3.0.*-*">
314+
<PackageReference Include="Mediator.SourceGenerator" Version="3.0.*">
319315
<PrivateAssets>all</PrivateAssets>
320316
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
321317
</PackageReference>
322-
<PackageReference Include="Mediator.Abstractions" Version="3.0.*-*" />
318+
<PackageReference Include="Mediator.Abstractions" Version="3.0.*" />
323319
```
324320

325321
### 4.2. Add Mediator to DI container
@@ -493,9 +489,6 @@ public sealed class GenericNotificationHandler<TNotification> : INotificationHan
493489

494490
### 4.9. Notification publishers
495491

496-
> [!IMPORTANT]
497-
> This API is currently in the latest 3.0 previews, not available in stable.
498-
499492
Notification publishers are responsible for dispatching notifications to a collection of handlers.
500493
There are two built in implementations:
501494

test/Mediator.SourceGenerator.Tests/_snapshots/BasicTests.Multiple_Notification_Handlers_One_Class#Mediator.g.verified.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Microsoft.Extensions.DependencyInjection
1818
/// <summary>
1919
/// DI extensions for Mediator.
2020
/// </summary>
21-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
21+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
2222
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
2323
[global::System.Diagnostics.DebuggerStepThroughAttribute]
2424
public static class MediatorDependencyInjectionExtensions
@@ -83,23 +83,23 @@ public static IServiceCollection AddMediator(this IServiceCollection services, g
8383

8484
namespace Mediator.Internals
8585
{
86-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
86+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
8787
internal interface IMessageHandlerBase
8888
{
8989
global::System.Threading.Tasks.ValueTask<object?> Handle(
9090
object request,
9191
global::System.Threading.CancellationToken cancellationToken
9292
);
9393
}
94-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
94+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
9595
internal interface INotificationHandlerBase
9696
{
9797
global::System.Threading.Tasks.ValueTask Handle(
9898
object notification,
9999
global::System.Threading.CancellationToken cancellationToken
100100
);
101101
}
102-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
102+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
103103
internal interface IStreamMessageHandlerBase
104104
{
105105
global::System.Collections.Generic.IAsyncEnumerable<object?> Handle(
@@ -108,15 +108,15 @@ internal interface IStreamMessageHandlerBase
108108
);
109109
}
110110

111-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
111+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
112112
internal interface IRequestHandlerBase<TResponse> : IMessageHandlerBase
113113
{
114114
global::System.Threading.Tasks.ValueTask<TResponse> Handle(
115115
global::Mediator.IRequest<TResponse> request,
116116
global::System.Threading.CancellationToken cancellationToken
117117
);
118118
}
119-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
119+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
120120
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
121121
[global::System.Diagnostics.DebuggerStepThroughAttribute]
122122
internal sealed class RequestHandlerWrapper<TRequest, TResponse> : IRequestHandlerBase<TResponse>
@@ -188,15 +188,15 @@ public RequestHandlerWrapper<TRequest, TResponse> Init(
188188
return await Handle((TRequest)request, cancellationToken);
189189
}
190190
}
191-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
191+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
192192
internal interface IStreamRequestHandlerBase<TResponse> : IStreamMessageHandlerBase
193193
{
194194
global::System.Collections.Generic.IAsyncEnumerable<TResponse> Handle(
195195
global::Mediator.IStreamRequest<TResponse> request,
196196
global::System.Threading.CancellationToken cancellationToken
197197
);
198198
}
199-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
199+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
200200
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
201201
[global::System.Diagnostics.DebuggerStepThroughAttribute]
202202
internal sealed class StreamRequestHandlerWrapper<TRequest, TResponse> : IStreamRequestHandlerBase<TResponse>
@@ -269,15 +269,15 @@ public StreamRequestHandlerWrapper<TRequest, TResponse> Init(
269269
yield return el;
270270
}
271271
}
272-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
272+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
273273
internal interface ICommandHandlerBase<TResponse> : IMessageHandlerBase
274274
{
275275
global::System.Threading.Tasks.ValueTask<TResponse> Handle(
276276
global::Mediator.ICommand<TResponse> request,
277277
global::System.Threading.CancellationToken cancellationToken
278278
);
279279
}
280-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
280+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
281281
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
282282
[global::System.Diagnostics.DebuggerStepThroughAttribute]
283283
internal sealed class CommandHandlerWrapper<TRequest, TResponse> : ICommandHandlerBase<TResponse>
@@ -349,15 +349,15 @@ public CommandHandlerWrapper<TRequest, TResponse> Init(
349349
return await Handle((TRequest)request, cancellationToken);
350350
}
351351
}
352-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
352+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
353353
internal interface IStreamCommandHandlerBase<TResponse> : IStreamMessageHandlerBase
354354
{
355355
global::System.Collections.Generic.IAsyncEnumerable<TResponse> Handle(
356356
global::Mediator.IStreamCommand<TResponse> request,
357357
global::System.Threading.CancellationToken cancellationToken
358358
);
359359
}
360-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
360+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
361361
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
362362
[global::System.Diagnostics.DebuggerStepThroughAttribute]
363363
internal sealed class StreamCommandHandlerWrapper<TRequest, TResponse> : IStreamCommandHandlerBase<TResponse>
@@ -430,15 +430,15 @@ public StreamCommandHandlerWrapper<TRequest, TResponse> Init(
430430
yield return el;
431431
}
432432
}
433-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
433+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
434434
internal interface IQueryHandlerBase<TResponse> : IMessageHandlerBase
435435
{
436436
global::System.Threading.Tasks.ValueTask<TResponse> Handle(
437437
global::Mediator.IQuery<TResponse> request,
438438
global::System.Threading.CancellationToken cancellationToken
439439
);
440440
}
441-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
441+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
442442
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
443443
[global::System.Diagnostics.DebuggerStepThroughAttribute]
444444
internal sealed class QueryHandlerWrapper<TRequest, TResponse> : IQueryHandlerBase<TResponse>
@@ -510,15 +510,15 @@ public QueryHandlerWrapper<TRequest, TResponse> Init(
510510
return await Handle((TRequest)request, cancellationToken);
511511
}
512512
}
513-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
513+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
514514
internal interface IStreamQueryHandlerBase<TResponse> : IStreamMessageHandlerBase
515515
{
516516
global::System.Collections.Generic.IAsyncEnumerable<TResponse> Handle(
517517
global::Mediator.IStreamQuery<TResponse> request,
518518
global::System.Threading.CancellationToken cancellationToken
519519
);
520520
}
521-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
521+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
522522
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
523523
[global::System.Diagnostics.DebuggerStepThroughAttribute]
524524
internal sealed class StreamQueryHandlerWrapper<TRequest, TResponse> : IStreamQueryHandlerBase<TResponse>
@@ -592,7 +592,7 @@ public StreamQueryHandlerWrapper<TRequest, TResponse> Init(
592592
}
593593
}
594594

595-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
595+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
596596
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
597597
[global::System.Diagnostics.DebuggerStepThroughAttribute]
598598
internal sealed class NotificationHandlerWrapper<TNotification> : INotificationHandlerBase
@@ -659,7 +659,7 @@ internal interface IContainerProbe { }
659659
internal sealed class ContainerProbe0 : IContainerProbe { }
660660
internal sealed class ContainerProbe1 : IContainerProbe { }
661661

662-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
662+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
663663
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
664664
[global::System.Diagnostics.DebuggerStepThroughAttribute]
665665
internal sealed class ContainerMetadata
@@ -719,7 +719,7 @@ namespace Mediator
719719
/// This type is also registered as a DI service.
720720
/// Can be used directly for high performance scenarios.
721721
/// </summary>
722-
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "3.0.0.0")]
722+
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "4.0.0.0")]
723723
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
724724
[global::System.Diagnostics.DebuggerStepThroughAttribute]
725725
public sealed partial class Mediator : global::Mediator.IMediator, global::Mediator.ISender, global::Mediator.IPublisher

0 commit comments

Comments
 (0)