2011-07-29 5 views
0

을 감안할 때 :성 윈저 등록 - 구현 UsingFactoryMethod()에 AddAdditionalInterfaces은()

public class IFoo { } 

public class IBar { } 

public class FooImpl : IFoo { } 

않는 이유는이 작품 :

container.Register(
    Component.For<IFoo>() 
      .ImplementedBy<FooImpl>() 
      .Proxy.AddAdditionalInterfaces(typeof(IBar)) 
); 

그리고이되지 않습니다

container.Register(
    Component.For<IFoo>() 
      .UsingFactoryMethod(kernal => new FooImpl()) 
      .Proxy.AddAdditionalInterfaces(typeof(IBar)) 
); 

등록 후 다음과 같이 주장합니다.

container.Resolve<IFoo>().IsAssignableFrom(typeof(IBar) 

답변

0

그냥 지원되지 않습니다 (FactoryMethodActivator은 프록시를 지원하지 않습니다). 추측 할만한 이유가 없으니 부담없이 request that feature.

+0

나는 그렇게 할 것입니다. 감사. –