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:
parent
1757c0e055
commit
0c4d145e20
@ -26,7 +26,7 @@ public static class DependencyInjection
|
|||||||
services.AddMediatR(cfg =>
|
services.AddMediatR(cfg =>
|
||||||
{
|
{
|
||||||
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
||||||
cfg.AddOpenBehaviors([typeof(BodyQueryBehavior<>)]);
|
cfg.AddOpenBehaviors([typeof(BodyQueryBehavior<>), typeof(HeaderQueryBehavior<>)]);
|
||||||
cfg.LicenseKey = configOpt.LuckyPennySoftwareLicenseKey;
|
cfg.LicenseKey = configOpt.LuckyPennySoftwareLicenseKey;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -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.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user