Skip to content

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

@cyrildurand

Description

@cyrildurand

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions