Exemplo n.º 1
0
        static void Main(string[] args)
        {
            using (ChannelFactory <IGreeting> ChannelFactory = new ChannelFactory <IGreeting>("greetingService"))
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    IGreeting proxy = ChannelFactory.CreateChannel();

                    proxy.SayHello("Foo");
                    proxy.SayGoodBye("Bar");
                    (proxy as ICommunicationObject).Close();
                    scope.Complete();
                }
            }
            Console.Read();
        }