Add PostprocessingBehavior to MediatR pipeline

Registered PostprocessingBehavior for InvokeRecActionViewCommand (with bool result) in the MediatR pipeline via DependencyInjection. This ensures both preprocessing and postprocessing behaviors are executed for this command.
This commit is contained in:
2026-03-24 14:41:41 +01:00
parent fdae4d26be
commit 690dcea7a8

View File

@@ -35,6 +35,7 @@ public static class DependencyInjection
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
cfg.AddOpenBehaviors([typeof(BodyQueryBehavior<,>), typeof(HeaderQueryBehavior<,>)]);
cfg.AddBehavior(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));
cfg.AddBehavior(typeof(IPipelineBehavior<InvokeRecActionViewCommand, bool>), typeof(PostprocessingBehavior));
cfg.AddBehavior(typeof(IPipelineBehavior<InvokeRecActionViewCommand, bool>), typeof(PreprocessingBehavior));
cfg.LicenseKey = configOpt.LuckyPennySoftwareLicenseKey;
});