I have method:
public ActionResult Index(IEmailRepository myEmails)
I want to inject into method parameter unsing castle windsor.
I have mapping that insert the mapped class into constructor,
container.Register(
Component.For<IEmailRepository>().ImplementedBy<EmailRepository>().LifeStyle.PerWebRequest);
but i do not know how to do this into method.
Any ideas?
You don’t do it in the method — you do it in the constructor and hold on to the reference in a class-level variable: