Add HeaderQueryBehavior and update DI configuration

Added `HeaderQueryBehavior<TRecAction>` to handle header query
processing in the MediatR pipeline. Updated the `DependencyInjection`
class to register `HeaderQueryBehavior<>` alongside
`BodyQueryBehavior<>` in the MediatR configuration. The new behavior
currently throws a `NotImplementedException` as its logic is pending
implementation.
This commit is contained in:
tekh 2025-11-27 15:47:12 +01:00
parent 1757c0e055
commit 0c4d145e20
2 changed files with 16 additions and 1 deletions

View File

@ -26,7 +26,7 @@ public static class DependencyInjection
services.AddMediatR(cfg =>
{
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
cfg.AddOpenBehaviors([typeof(BodyQueryBehavior<>)]);
cfg.AddOpenBehaviors([typeof(BodyQueryBehavior<>), typeof(HeaderQueryBehavior<>)]);
cfg.LicenseKey = configOpt.LuckyPennySoftwareLicenseKey;
});

View File

@ -0,0 +1,15 @@
using MediatR;
using ReC.Application.Common.Dto;
namespace ReC.Application.RecActions.Behaviors
{
public class HeaderQueryBehavior<TRecAction> : IPipelineBehavior<TRecAction, Unit>
where TRecAction : RecActionDto
{
public Task<Unit> Handle(TRecAction action, RequestHandlerDelegate<Unit> next, CancellationToken cancel)
{
// Logic to process the header query can be added here
throw new NotImplementedException("HeaderQueryBehavior is not implemented yet.");
}
}
}