Skip to content

Open behavior multiple registration extensions#1065

Merged
jbogard merged 2 commits intoLuckyPennySoftware:masterfrom
Emopusta:feature/open-behavior-multiple-addition-extension
Sep 11, 2024
Merged

Open behavior multiple registration extensions#1065
jbogard merged 2 commits intoLuckyPennySoftware:masterfrom
Emopusta:feature/open-behavior-multiple-addition-extension

Conversation

@Emopusta
Copy link
Copy Markdown
Contributor

@Emopusta Emopusta commented Aug 28, 2024

Hello,

I was adding multiple behaviors to my project and I didn't want to put my every behavior one by one like this:

services.AddMediatR(configuration =>
        {
            configuration.AddOpenBehavior(typeof(MyBehavior<,>));
            configuration.AddOpenBehavior(typeof(MyBehavior2<,>));
        });

so I decided to create my own AddBehaviors extension to add my behaviors by list at once. I thought this could help others without implementing their own extension.

Furthermore, I noticed there is a optional service lifetime implementation inside AddOpenBehavior so I added another extension with OpenBehavior entity. This helps developer to set every behavior service lifetime individually while registering their behaviors with multiple registration.

@Emopusta
Copy link
Copy Markdown
Contributor Author

Emopusta commented Sep 4, 2024

@zachpainter77 What is the relevancy between my pull request and your Timeout behavior support #1058 pull request. Can you explain why did you mention as a "direct response" to this pull request?

@zachpainter77
Copy link
Copy Markdown
Contributor

zachpainter77 commented Sep 10, 2024

@zachpainter77 What is the relevancy between my pull request and your Timeout behavior support #1058 pull request. Can you explain why did you mention as a "direct response" to this pull request?

Sorry I must have been mistaken.. I don't think these are actually related.. I'll remove that from my pr.

Edit: Actually it was a typo I meant to reference #1056

@jbogard jbogard merged commit 585f0dc into LuckyPennySoftware:master Sep 11, 2024
@Emopusta Emopusta deleted the feature/open-behavior-multiple-addition-extension branch September 11, 2024 18:34
@Emopusta Emopusta restored the feature/open-behavior-multiple-addition-extension branch September 11, 2024 18:41
This was referenced Jul 21, 2025
sloweyyy added a commit to sloweyyy/cloud-native-ecommerce-platform that referenced this pull request Mar 22, 2026
Updated [MediatR](https://github.com/jbogard/MediatR) from 12.3.0 to
12.5.0.

<details>
<summary>Release notes</summary>

_Sourced from [MediatR's
releases](https://github.com/jbogard/MediatR/releases)._

## 12.5.0

## What's Changed
* Open behavior multiple registration extensions by @​Emopusta in
LuckyPennySoftware/MediatR#1065
* Remove duplicate `Nullable` property from `MediatR.Contracts` by
@​jithu7432 in LuckyPennySoftware/MediatR#1061
* Timeout behavior support by @​zachpainter77 in
LuckyPennySoftware/MediatR#1058
* GitHub Actions upload-artifacts@​v2 deprecated moving to v4 by
@​jithu7432 in LuckyPennySoftware/MediatR#1072
* update MinVer from 4.3.0 to 6.0.0 by @​adamralph in
LuckyPennySoftware/MediatR#1102
* Update setup-dotnet package version. by @​Emopusta in
LuckyPennySoftware/MediatR#1086
* Add test for multiple open behavior registration feature. by
@​Emopusta in LuckyPennySoftware/MediatR#1077
* Add validation and comments to OpenBehavior entity. by @​Emopusta in
LuckyPennySoftware/MediatR#1078
* Passing CancellationToken to the call chain by @​podobaas in
LuckyPennySoftware/MediatR#1100

## New Contributors
* @​Emopusta made their first contribution in
LuckyPennySoftware/MediatR#1065
* @​jithu7432 made their first contribution in
LuckyPennySoftware/MediatR#1061
* @​podobaas made their first contribution in
LuckyPennySoftware/MediatR#1100

**Full Changelog**:
LuckyPennySoftware/MediatR@v12.4.1...v12.5.0

## 12.4.1

## What's Changed
* Make Auto Registration of Generic Handlers OPT-IN by @​zachpainter77
in LuckyPennySoftware/MediatR#1057


**Full Changelog**:
LuckyPennySoftware/MediatR@v12.4.0...v12.4.1

## 12.4.0

## What's Changed
* Add Support For Generic Handlers With Multiple Generic Type Parameters
by @​zachpainter77 in LuckyPennySoftware/MediatR#1048


**Full Changelog**:
LuckyPennySoftware/MediatR@v12.3.0...v12.4.0

Commits viewable in [compare
view](LuckyPennySoftware/MediatR@v12.3.0...v12.5.0).
</details>

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

> **Note**
> Automatic rebases have been disabled on this pull request as it has
been open for over 30 days.
sloweyyy added a commit to sloweyyy/cloud-native-ecommerce-platform that referenced this pull request Mar 25, 2026
Updated [MediatR](https://github.com/jbogard/MediatR) from 12.3.0 to
12.5.0.

<details>
<summary>Release notes</summary>

_Sourced from [MediatR's
releases](https://github.com/jbogard/MediatR/releases)._

## 12.5.0

## What's Changed
* Open behavior multiple registration extensions by @​Emopusta in
LuckyPennySoftware/MediatR#1065
* Remove duplicate `Nullable` property from `MediatR.Contracts` by
@​jithu7432 in LuckyPennySoftware/MediatR#1061
* Timeout behavior support by @​zachpainter77 in
LuckyPennySoftware/MediatR#1058
* GitHub Actions upload-artifacts@​v2 deprecated moving to v4 by
@​jithu7432 in LuckyPennySoftware/MediatR#1072
* update MinVer from 4.3.0 to 6.0.0 by @​adamralph in
LuckyPennySoftware/MediatR#1102
* Update setup-dotnet package version. by @​Emopusta in
LuckyPennySoftware/MediatR#1086
* Add test for multiple open behavior registration feature. by
@​Emopusta in LuckyPennySoftware/MediatR#1077
* Add validation and comments to OpenBehavior entity. by @​Emopusta in
LuckyPennySoftware/MediatR#1078
* Passing CancellationToken to the call chain by @​podobaas in
LuckyPennySoftware/MediatR#1100

## New Contributors
* @​Emopusta made their first contribution in
LuckyPennySoftware/MediatR#1065
* @​jithu7432 made their first contribution in
LuckyPennySoftware/MediatR#1061
* @​podobaas made their first contribution in
LuckyPennySoftware/MediatR#1100

**Full Changelog**:
LuckyPennySoftware/MediatR@v12.4.1...v12.5.0

## 12.4.1

## What's Changed
* Make Auto Registration of Generic Handlers OPT-IN by @​zachpainter77
in LuckyPennySoftware/MediatR#1057


**Full Changelog**:
LuckyPennySoftware/MediatR@v12.4.0...v12.4.1

## 12.4.0

## What's Changed
* Add Support For Generic Handlers With Multiple Generic Type Parameters
by @​zachpainter77 in LuckyPennySoftware/MediatR#1048


**Full Changelog**:
LuckyPennySoftware/MediatR@v12.3.0...v12.4.0

Commits viewable in [compare
view](LuckyPennySoftware/MediatR@v12.3.0...v12.5.0).
</details>

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

> **Note**
> Automatic rebases have been disabled on this pull request as it has
been open for over 30 days.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants