3
基本上我可以注册一个这样的服务。如何注册我的所有服务与城堡温莎wcf设施
Container.Register(Component.For<IMyService>()
.AsWcfClient(new DefaultClientModel() {
Endpoint = WcfEndpoint
.BoundTo(new NetNamedPipeBinding())
.At("net.pipe://localhost/MyService") })
.LifeStyle.PerWebRequest);
但我不知道如何注册我的所有服务类似的配置。
我希望能运行是这样的事情...
Container.Register(
AllTypes.FromAssemblyNamed("My.Server.MyContracts")
.Pick().If(x => x.Name.EndsWith("Service"))
.Configure(configurer => configurer.Named(configurer.Implementation.Name)
.AsWcfClient(new DefaultClientModel
{
Endpoint = WcfEndpoint.BoundTo(new NetNamedPipeBinding())
.At(string.Format("net.pipe://localhost/{0}", configurer.Named(configurer.Implementation.Name)).Substring(1))
}))
.LifestylePerWebRequest()
);
如何注册的所有服务为WCF客户端?