private static void NotificationTest() { var connectionString = ConfigurationManager.ConnectionStrings["Watchman"].ConnectionString; DataNotificator.Register(connectionString, "TestDB", "User"); var notificator = DataNotificator.Instance; notificator.OnDataUpdated += (s, e) => { Console.WriteLine("Your table was changed!"); var x = e.GetNotificationObject <User>(); }; notificator.Listen(); Console.ReadLine(); notificator.Stop(); }
private static void NotificationTest() { var connectionString = ConfigurationManager.ConnectionStrings["Lobster"].ConnectionString; DataNotificator.Register(connectionString, "TestDB", "Notifications"); var notificator = DataNotificator.Instance; notificator.OnDataUpdated += (s, e) => { Console.WriteLine("Your table was changed!"); var x = e.GetNotificationObject <DataAccess.Entities.Notification>(); }; notificator.Listen(); Console.WriteLine("Listener run!"); Console.ReadLine(); notificator.Stop(); }