【发布时间】:2013-03-20 23:08:54
【问题描述】:
我有一个 WCF 服务,我正在尝试使用 Castle Windsor 来解决它。以前的注册是这样的:
container.Register(Component.For<IBatchDataService>()
.AsWcfClient(WCFEndpoint
.FromConfiguration("Internal.IBatchDataService"))
.LifestyeTransient())
现在我创建了一个进程中的代理。它公开相同的接口 (IBatchDataService) 并将 WCF 服务的引用作为构造函数参数。如何在 Windsor 中进行设置,以便将任何其他类解析为使用代理类,但代理类解析为 WCF 服务。我现在有这个:
container.Register(Component.For<IBatchDataService>()
.ImplementedBy<BatchDataServiceClient>());
应该解析新的代理类。
【问题讨论】:
标签: c# wcf castle-windsor wcffacility