jbogard / MediatR

Simple, unambitious mediator implementation in .NET
Apache License 2.0
10.91k stars 1.16k forks source link

How to replicate previous api for registering pre/post processors #963

Closed hisuwh closed 3 months ago

hisuwh commented 9 months ago

The guide for migrating to v12.1 is a bit unclear to me: https://github.com/jbogard/MediatR/wiki/Migration-Guide-12.0-to-12.1

We have dozens of pre/post processors and this makes it seem as if I would need to add them all individually when upgrading to 12.1

jbogard commented 9 months ago

Dozens? They're supposed to be analogous to filters in ASP.NET Core. Cross cutting concerns across multiple handlers with no domain logic.

But yes, because order matters you need to register them explicitly in the order you want them to execute. It was a mistake to ever auto-register them.

hisuwh commented 9 months ago

We have generic commands/handlers for CRUD operations and are using PostProcessors for side effects (notifications, updating related records etc.) that are specific to a certain type. We don't have any open PostProcessors and order doesn't matter to us.

We are using PipelineBehaviours for cross-cutting concerns.

jbogard commented 9 months ago

Ah jeez my bad I was thinking pipeline behaviors not pre/post processors. One option is to include an "AutoRegisterRequestProcessors" flag or similar so that those can get registered by default as well.

Those are ordered as well which is why they were switched to manual, but if every handler only has 0-1 processors then order wouldn't matter.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

hisuwh commented 7 months ago

@jbogard do I still need to register the behaviours manually? Looks like this was taken out: https://github.com/jbogard/MediatR/commit/9ebdf7b5305e161456224afe3193de1bf21ca6ed#diff-c4d1d5960b86a86bee0fd5974803c90f8656cde09914a4c43ae14dc193c3cf35L237

hisuwh commented 7 months ago

I found a bug which I have fixed: https://github.com/jbogard/MediatR/pull/989

hisuwh commented 5 months ago

@jbogard any idea when the next release might be including #989 ?

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] commented 3 months ago

This issue was closed because it has been stalled for 14 days with no activity.