Exemplo n.º 1
0
 public static void Main(string[] args)
 {
     Uri address = new Uri("net.pipe://localhost/Service/");
     ServiceHost host = new ServiceHost(new Service(), address);
     NetNamedPipeBinding binding = new NetNamedPipeBinding();
     host.AddServiceEndpoint(typeof(IContractA), binding, string.Empty);
     host.AddServiceEndpoint(typeof(IContractB), binding, string.Empty);
     host.AddServiceEndpoint(typeof(IContractC), binding, string.Empty);
     host.Open();
     IContractA proxyA = ChannelFactory<IContractA>.CreateChannel(new NetNamedPipeBinding(), new EndpointAddress(address));
     proxyA.A();
     ((IClientChannel)proxyA).Close();
     IContractB proxyB = ChannelFactory<IContractB>.CreateChannel(new NetNamedPipeBinding(), new EndpointAddress(address));
     proxyB.B();
     ((IClientChannel)proxyB).Close();
     IContractC proxyC = ChannelFactory<IContractC>.CreateChannel(new NetNamedPipeBinding(), new EndpointAddress(address));
     proxyC.C();
     ((IClientChannel)proxyC).Close();
     host.Close();
 }
 public ConstructorParameterImportContractX([Import(ContractNames.ContractX)] IContractA a)
 {
 }
 public NoConstructorParameterOverrides(IContractA a)
 {
 }
 public TwoConstructorsWithOverride(IContractA a, IContractB b)
 {
 }