1
그래, 특정 인터페이스의 임의의 구현을 만들고이를 해결하려고합니다. 실제로 플러그인 시스템과 유사합니다. "intereface X의 자신의 구현을 작성하고 응용 프로그램은 나머지 않습니다"내 implemantations가 내 컨테이너 등록을 확인하고 이름이 클래스의 이름 인 경우하나의 인터페이스에 대한 모든 구현을 단일하게 해결하는 방법은 무엇입니까?
public interface IMenuEntry { ... }
// auto-mapping (registration-by-convention)
_container.RegisterTypes(AllClasses.FromAssemblies(assemblies),
WithMappings.FromMatchingInterface,
// ResolveAll need names for multiple registrations of the same type (?)
WithName.TypeName,
WithLifetime.ContainerControlled);
var g = _container.ResolveAll<IMenuEntry>(); // empty - why?
을 -하지 인터페이스. 훌륭한. 그러나 IMenuEntry
의 모든 구현을 해결할 수없는 이유는 무엇입니까? 항상 비어 있습니다.
오오 ... 음 ... 문서를 한 눈에 볼 때 이러한 단점이 있습니다. 내 문제가 해결되었습니다. 고맙습니다! – Brettetete