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

Add a RegisterLazy methods that accept a Func<...> instead of IRegistrationMutator #3

Open
cyrildurand opened this issue Feb 2, 2022 · 0 comments

Comments

@cyrildurand
Copy link

I have case where I need to use the WithParameter method on the original type :

ie :

builder.RegisterLazy<IEventSender, CompositeEventSender>()
            .WithParameter((pi, c) => pi.ParameterType == typeof(IEnumerable<IEventSender>), (pi, c) => c.ResolveNamed<IEnumerable<IEventSender>>("inner"));

I understand why I can't use this code and I need to implement a IRegistrationMutator

builder.RegisterLazy<IEventSender, CompositeEventSender>(myMutator); 

instead of having to implement a whole classe that will be used only once would that be possible to add a new parameter to the RegisterLazy

builder.RegisterLazy<IEventSender, CompositeEventSender>(b => b.WithParameter(...)) 

Let me know if you want me to make a pull request

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

No branches or pull requests

1 participant