Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hisuwh opened this issue Oct 16, 2023 · 9 comments
Closed

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

hisuwh opened this issue Oct 16, 2023 · 9 comments
Labels

Comments

@hisuwh
Copy link
Contributor

hisuwh commented Oct 16, 2023

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
Copy link
Owner

jbogard commented Oct 17, 2023

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
Copy link
Contributor Author

hisuwh commented Oct 17, 2023

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
Copy link
Owner

jbogard commented Oct 18, 2023

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.

Copy link

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 github-actions bot added the Stale label Dec 18, 2023
@hisuwh
Copy link
Contributor Author

hisuwh commented Dec 28, 2023

@jbogard do I still need to register the behaviours manually? Looks like this was taken out:
9ebdf7b#diff-c4d1d5960b86a86bee0fd5974803c90f8656cde09914a4c43ae14dc193c3cf35L237

@github-actions github-actions bot removed the Stale label Dec 29, 2023
@hisuwh
Copy link
Contributor Author

hisuwh commented Dec 29, 2023

I found a bug which I have fixed:
#989

@hisuwh
Copy link
Contributor Author

hisuwh commented Feb 16, 2024

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

Copy link

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 github-actions bot added the Stale label Apr 16, 2024
Copy link

github-actions bot commented May 1, 2024

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants