I have a scene, some interfaces, and also a registration section. The problem is that I need to define some parameters as fixed and others as variables.
interface IDoSomething { void DoWork(); } interface IDoMath(){ void DoWork(); } interface IBehaviorBusiness{ void Do(); } class BehaviorBusiness { ... public BehaviorBusiness(IDoSomething doSomething, IDoMatch doMatch, string connection){}; ... }
Is it possible with the windsor container to define the parameter connection in the declaration and take IDosomething and IDoMatch from the container?
container.Register( Component.For<IDoSomething>() ... } container.Register( Component.For<IDoMatch>() ... );
This is a specific problem.
container.Register( Component.For<IBehaviorBusiness>() .ImplementedBy<BehaviorBusiness>() .DependsOn(Dependency.OnComponent<IDoSomething, [default]>(), Dependency.OnComponent<IDoMatch, [default]>(), Dependency.OnValue("connection", connectionString)) .LifeStyle.Transient );
What is the correct syntax if it exists?
source share