c# - Castle.Windsor: passing a dependency through 2 typed factories -
types:
public interface iwidgetfactoryfactory { iwidgetfactory createfactory(); } public interface iwidgetfactory { foowidget createfoo(foo model); } public class foowidget(icontextualservice service, foo model) { }
registration:
component.for<iwidgetfactoryfactory>() .asfactory(), // customfactorycomponentselector unnecessary discussion, know // it's there component.for<iwidgetfactory>() .asfactory(c => c.selectedwith<customfactorycomponentselector>()),
question:
what want able add method iwidgetfactoryfactory
take icontextualservice
:
iwidgetfactory createfactory(icontextualservice service);
and create factory proxy such when call iwidgetfactory.createfoo
resolves icontextualservice
dependency parameter passed via new createfactory
method.
note creating , calling multiple iwidgetfactoryfactory.createfactory(icontextualservice)
in different contexts, , want each icontextualservice
reflect context called in , passed from.
are there ideas on how done?
update: there related thread on castle-dev mailing list on issue.
Comments
Post a Comment