0
interface IFoo<T> { }
interface IBar { }
class BarImpl : IBar { }
class FooImplA : IFoo<IBar> { }
class FooImplB : IFoo<BarImpl> { }
container.Register(
AllTypes.Of(typeof(IFoo<>)).From(assem)
.WithService.FirstInterface());
var bars = container.ResolveAll<IFoo<BarImpl>>();
는 설치 윈저 컨테이너 해상도 어쨌든이 있나요?윈저 해결 일반 서비스 아형
예 ... 그렇습니다. 저는 BarImpl : IBar에 대해 언급하는 것을 잊었습니다. 그래서 성에서 할 수있는 방법이 없습니까? 내가 진정으로 원하는 것은 IFoo을 반환 유형으로, 특정 impl을 조회 유형으로 사용하는 것입니다. 나는 모든 유형의 IBar를 등록해야한다는 것을 알고 있습니다. 내가 할 수있는 관례가 없니? IFoo 을 얻으려면 container에 typeof (T) .IsAssignableFrom (typeof (BarImpl))이있는 모든 유형을 찾으십시오. –
neouser99