我有一个WCF服务,我试图使用温莎城堡解决。看惯了这样的登记:如何解决温莎城堡代理类
container.Register(Component.For<IBatchDataService>()
.AsWcfClient(WCFEndpoint
.FromConfiguration("Internal.IBatchDataService"))
.LifestyeTransient())
现在我已经创建了一个生活在过程中的代理。它公开了相同的接口(IBatchDataService),并将WCF服务的引用作为构造函数参数。我如何在Windsor中设置它,以便其他任何类都可以使用代理类,但代理类会解析为WCF服务。我现在有这个:
container.Register(Component.For<IBatchDataService>()
.ImplementedBy<BatchDataServiceClient>());
应该解决新的代理类。