Refactor action behaviors to use Unit instead of bool

Refactored PreprocessingBehavior and PostprocessingBehavior for InvokeRecActionViewCommand to use MediatR's Unit as the response type instead of bool. Updated method signatures, return values, and DI registration accordingly to align with MediatR conventions for commands without return values.
This commit is contained in:
2026-03-24 16:01:24 +01:00
parent dbe09cd07b
commit 2ca85a2372
3 changed files with 10 additions and 11 deletions

View File

@@ -35,8 +35,8 @@ 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.AddBehavior(typeof(IPipelineBehavior<InvokeRecActionViewCommand, Unit>), typeof(PostprocessingBehavior));
cfg.AddBehavior(typeof(IPipelineBehavior<InvokeRecActionViewCommand, Unit>), typeof(PreprocessingBehavior));
cfg.LicenseKey = configOpt.LuckyPennySoftwareLicenseKey;
});