Skip to content

Commit

Permalink
Fixed unhandled exception on .NET 8.
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-peshkov committed Nov 24, 2023
1 parent 0c5f430 commit d622232
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Cross.CQRS/Commands/AsyncRequestHandlerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
/// <summary>
/// Wrapper class for a handler that asynchronously handles a request and does not return a response
/// </summary>
/// <typeparam name="TRequest">The type of request being handled</typeparam>
public abstract class AsyncRequestHandlerBase<TCommnd> : IRequestHandler<TCommnd>
where TCommnd : IRequest
/// <typeparam name="TCommand">The type of request being handled</typeparam>
public abstract class AsyncRequestHandlerBase<TCommand> : IRequestHandler<TCommand>
where TCommand : ICommand
{
async Task<Unit> IRequestHandler<TCommnd, Unit>.Handle(TCommnd command, CancellationToken cancellationToken)
async Task<Unit> IRequestHandler<TCommand, Unit>.Handle(TCommand command, CancellationToken cancellationToken)
{
await Handle(command, cancellationToken).ConfigureAwait(false);
return Unit.Value;
Expand All @@ -19,5 +19,5 @@ async Task<Unit> IRequestHandler<TCommnd, Unit>.Handle(TCommnd command, Cancella
/// <param name="command">Request</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Response</returns>
public abstract Task Handle(TCommnd command, CancellationToken cancellationToken);
public abstract Task Handle(TCommand command, CancellationToken cancellationToken);
}
4 changes: 2 additions & 2 deletions Cross.CQRS/Cross.CQRS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</Target>

<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.8.0" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.8.0" />
<PackageReference Include="FluentValidation" Version="11.8.1" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.8.1" />

<PackageReference Include="MediatR" Version="11.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.1.0" />
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Main Features:

Here included validation behavior based on FluentValidation, that allow to validate Queries and Command before their execution.

* **.NET Standard 2.1 and Source Linking**.
* **.NET frameworks and Source Linking**.

From version 1.0 repository contains .NET Standard 2.0, .NET 6, .NET 7 and .NET 8 projects.
Source linking enabled and symbol package is published to nuget symbols server, making debugging easier.
Expand Down
4 changes: 4 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ Updated version to correlate with .NET version.

8.0.0
Added support for .NET 8.

8.0.1
Fixed unhandled exception on .NET 8. System.TypeLoadException: GenericArguments[0], 'TCommnd', on 'MediatR.IRequestHandler`2[TRequest,TResponse]' violates the constraint of type parameter 'TRequest'.
Upgrade packages.
9 changes: 5 additions & 4 deletions _nuget/config.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Cross.CQRS</id>
<version>8.0.0</version>
<version>8.0.1</version>
<authors>denis-peshkov</authors>
<owners>denis-peshkov</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand All @@ -11,14 +11,15 @@
<projectUrl>https://github.com/denis-peshkov/Cross.CQRS</projectUrl>
<icon>icon.png</icon>
<releaseNotes>
Added support for .NET 8.
Fixed unhandled exception on .NET 8. System.TypeLoadException: GenericArguments[0], 'TCommnd', on 'MediatR.IRequestHandler`2[TRequest,TResponse]' violates the constraint of type parameter 'TRequest'.
Upgrade packages.
</releaseNotes>
<description>Simple .NET MediatR base Query, Command, Event. Event Queue and Validation behaviors. Written on C#.</description>
<tags>.NET Mediatr Query QueryHandler Command CommandHandler Event EventHandler EventQueueBehavior Validation ValidationBehavior SyntaxNotes NetCore</tags>
<repository type="git" url="https://github.com/denis-peshkov/Cross.CQRS" />
<dependencies>
<dependency id="FluentValidation" version="11.8.0" />
<dependency id="FluentValidation.DependencyInjectionExtensions" version="11.8.0" />
<dependency id="FluentValidation" version="11.8.1" />
<dependency id="FluentValidation.DependencyInjectionExtensions" version="11.8.1" />
<dependency id="MediatR" version="11.1.0" />
<dependency id="MediatR.Extensions.Microsoft.DependencyInjection" version="11.1.0" />
<dependency id="Microsoft.Extensions.Configuration" version="8.0.0" />
Expand Down

0 comments on commit d622232

Please sign in to comment.