Sunday 15 June 2014

c# - How do you pass an IOC target into another IOC target using Castle Windsor? -


My question is probably terrible, but that's what I'm trying to use Castle Windsor in the pseudo code: / P>

  Register as IFoo Register as Foo Register as bar when IFoo is passed in a constructor and is being resolved for FU: Frequent and often typefoffof ( FU) in the IBar.Create () method [resolution & lt; IBar & gt; () () () () () () () () () () () () ())   

The goal is that I try to use IFoo as a dependency I want to pass the IFoo (Foo) type of implementation

Any ideas?

Post text "itemprop =" text ">

Not entirely sure that you What are you trying to do with this example? Only one thing I can suggest is that it will be handled in some solid type (nothing to do with Castle Windsor), therefore:

  public class Fu {public fu (repeatedly) {bar.Create (typeof (Foo));}}   

Edit: What are you saying Do you want Fu to be the bar form Made in A. In that case, coupling between the factories and the types is acceptable for the purpose of making it, so you can pass the factory IBRR in any category for which a frequency of IFoo is required and the method to make the direct Call if you require, then you can switch the Fancy Implementation Mapping of IBF, which gives you all the concrete converter of IFU. < / Div>

No comments:

Post a Comment