mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 08:11:10 +00:00
Upgrades solution and packages to .NET 9
This commit is contained in:
1 parent
246392af5c
commit
e2b292009f
18 files changed
+144
-113
No files matched your search
@@ -3,7 +3,6 @@ using ErrorOr;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
@@ -11,7 +10,7 @@ using System.Threading.Tasks;
|
||||
namespace Lumina.Application.Common.Behaviors;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a validation behavior in the MediatR pipeline for handling requests and responses.
|
||||
/// Represents a validation behavior in the Mediator pipeline for handling requests and responses.
|
||||
/// </summary>
|
||||
/// <typeparam name="TRequest">The type representing a request. It should implement <see cref="IRequest{TResponse}"/>.</typeparam>
|
||||
/// <typeparam name="TResponse">The type representing a response. It should implement <see cref="IErrorOr"/> interface.</typeparam>
|
||||
@@ -35,7 +34,7 @@ public class ValidationBehavior<TRequest, TResponse> : IPipelineBehavior<TReques
|
||||
/// <param name="request">Incoming request.</param>
|
||||
/// <param name="next">Awaitable delegate for the next action in the pipeline. Eventually this delegate represents the handler.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public async ValueTask<TResponse> Handle(TRequest request, CancellationToken cancellationToken, MessageHandlerDelegate<TRequest, TResponse> next)
|
||||
public async ValueTask<TResponse> Handle(TRequest request, MessageHandlerDelegate<TRequest, TResponse> next, CancellationToken cancellationToken)
|
||||
{
|
||||
// if there is no validator, just invoke the handler
|
||||
if (_validator is null)
|
||||
@@ -51,4 +50,4 @@ public class ValidationBehavior<TRequest, TResponse> : IPipelineBehavior<TReques
|
||||
// this is acceptable because we DO know that we will always have a list of errors of type ErrorOr (check the generic constraint at the top of the class!)
|
||||
return (dynamic)errors;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user