1
나는 다음과 같은 클래스가 다음과 같이 코드에서 내가 그들을 등록Castle Windsor의 코드에서 Array/List 종속성을 설정하려면 어떻게합니까?
class Repository : IRepository
class ReadOnlyRepository : Repository
abstract class Command
abstract CommandImpl : Command
{
public CommandImpl(Repository repository){}
}
class Service
{
public Service (Command[] commands){}
}
을 :
var container = new Container("WindsorCOntainer.config");
var container = new WindsorContainer(new XmlInterpreter("WindsorConfig.xml"));
container.Kernel.Resolver.AddSubResolver(new ArrayResolver(container.Kernel));
container.AddComponent("repository", typeof(RentServiceRepository));
container.Resolve<RentServiceRepository>();
container.AddComponent("command", typeof(COmmandImpl));
container.AddComponent("rentService", typeof (RentService));
container.Resolve<RentService>(); // Fails here
나는
무엇 오전 "RentService 종속성 명령을 기다리고 있습니다"라는 메시지가 내가 잘못하고있어?
감사합니다, 당신은 Command
로 CommandImpl
를 등록하지 않을
... 그래 ... 바보 미스를 숙지하는 것이 좋습니다. –