Skip to content

Commit

Permalink
Bump .NET versions
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardSmit committed Dec 21, 2023
1 parent 0fc0119 commit 72c8893
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
24 changes: 8 additions & 16 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,21 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test Mediator.SourceGenerator
run: dotnet test --no-restore --verbosity normal tests/Mediator.SourceGenerator.Tests/Mediator.SourceGenerator.Tests.csproj
- name: Publish Mediator
uses: alirezanet/publish-nuget@v3.0.4
- name: Publish
uses: GerardSmit/publish-nuget@v3.1.2
with:
VERSION_FILE_PATH: src/Directory.Build.props
PROJECT_FILE_PATH: src/Mediator/Mediator.csproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
- name: Publish Mediator.DependencyInjection
uses: alirezanet/[email protected]
with:
VERSION_FILE_PATH: src/Directory.Build.props
PROJECT_FILE_PATH: src/Mediator.DependencyInjection/Mediator.DependencyInjection.csproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
- name: Publish Mediator.SourceGenerator
uses: alirezanet/[email protected]
with:
VERSION_FILE_PATH: src/Directory.Build.props
PROJECT_FILE_PATH: src/Mediator.SourceGenerator/Mediator.SourceGenerator.csproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
PROJECT_FILE_PATH: |
src/Mediator/Mediator.csproj
src/Mediator.DependencyInjection/Mediator.DependencyInjection.csproj
src/Mediator.SourceGenerator/Mediator.SourceGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ private class HandlerRegistration : IHandlerRegistration

public HandlerRegistration(
INotificationCache owner,
Func<T, IServiceProvider, object, CancellationToken, ValueTask> invoke, T handler,
Func<T, IServiceProvider, object, CancellationToken, ValueTask> invoke,
T handler,
Func<Func<Task>, Task>? middleware)
{
Invoke = invoke;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public async ValueTask Publish<TNotification>(MediatorNamespace ns, TNotificatio
}

/// <inheritdoc />
public IDisposable RegisterNotificationHandler(object handler, Func<Func<Task>, Task>? invokeAsync = null, bool queue = false)
public IDisposable RegisterNotificationHandler(object handler, Func<Func<Task>, Task>? invokeAsync = null, bool queue = true)
{
if (queue)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ public IAsyncEnumerable<TResponse> Handle(MediatorNamespace ns, object streamReq

async IAsyncEnumerable<object?> IStreamRequestWrapper.Handle(MediatorNamespace ns, object streamRequest, CancellationToken cancellationToken, IMediator mediator)
{
await foreach(var response in Handle(ns, (TRequest)streamRequest, cancellationToken, mediator))
await foreach(var response in Handle(ns, streamRequest, cancellationToken, mediator))
{
yield return response;
}
}

async IAsyncEnumerable<object?> IStreamRequestWrapper.Handle(object streamRequest, CancellationToken cancellationToken, IMediator mediator)
{
await foreach(var response in Handle((TRequest)streamRequest, cancellationToken, mediator))
await foreach(var response in Handle(streamRequest, cancellationToken, mediator))
{
yield return response;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Mediator/IPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ ValueTask Publish<TNotification>(MediatorNamespace ns, TNotification notificatio
/// <param name="invokeAsync">Middleware to invoke the handler</param>
/// <param name="queue">Queue the handler instead of invoking it immediately</param>
/// <returns>A disposable object that can be used to unregister the handler.</returns>
IDisposable RegisterNotificationHandler(object handler, Func<Func<Task>, Task>? invokeAsync = null, bool queue = false);
IDisposable RegisterNotificationHandler(object handler, Func<Func<Task>, Task>? invokeAsync = null, bool queue = true);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net461;net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down

0 comments on commit 72c8893

Please sign in to comment.