private static IChangeTrackingSubscriptions Execute() { var client = new DuplexChannelFactoryClient <IChangeTrackingSubscriptions, IEventNotificationCallback> (new CallbackCleint(), ServiceUrl.SqlTrackingWcfServiceAddress); var channel = client.CreateChannel(); ((ICommunicationObject)channel).Opened += Channel_Opned; ((ICommunicationObject)channel).Closed += Channel_Closed; ((ICommunicationObject)channel).Faulted += Channel_Faulted; return(channel); }
private static void Execute() { var client = new DuplexChannelFactoryClient <IChangeTrackingSubscriptions, IEventNotificationCallback> (new CallbackCleint(), "net.tcp://localhost:9002/Sql.ChangeTracking.Wcf/wcf/SqlChangeTrackingWcfService"); var channel = client.CreateChannel(); ((ICommunicationObject)channel).Opened += Channel_Opned; ((ICommunicationObject)channel).Closed += Channel_Closed; ((ICommunicationObject)channel).Faulted += Channel_Faulted; // Subscribe as "Client1" and wait for changes to "Customer" table channel.Subscribe("Client1", "Customer"); channel.Subscribe("Client1", "Employee"); }