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

Feature Request: add global .WithDefaultServiceTypeCondition(Func<Type, bool> condition) method #640

Open
ChaseFlorell opened this issue Apr 9, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ChaseFlorell
Copy link

ChaseFlorell commented Apr 9, 2024

Given the global Rules support within DryIoc, I would like to see an option to add a default serviceTypeCondition for all of my RegisterMany calls.

var container = new Container(Rules.Default
                                   .WithDefaultServiceTypeCondition(type => type.IsInterface))

The default behavior can still be ImTools Fun.Always when this method isn't overridden, but this would give us the ability to apply the same configuration across the entire application without the explicit need to call it on every registration.

@ChaseFlorell ChaseFlorell changed the title Feature Request: add global .WithDefaultServiceTypeCondition method Feature Request: add global .WithDefaultServiceTypeCondition(Func<Type, bool> condition) method Apr 9, 2024
@dadhi
Copy link
Owner

dadhi commented Apr 10, 2024

@ChaseFlorell Thanks for suggestion.

I think we need more RegisterMany targeted thingy,
e.g. WithRegisterManyRules(serviceTypeConditon: t => t.IsInterface).
So we keep the door open to extend it later.

@dadhi dadhi self-assigned this Apr 10, 2024
@dadhi dadhi added the enhancement New feature or request label Apr 10, 2024
@dadhi dadhi added this to the v6.0.0 milestone Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants