Created
January 13, 2018 18:19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string connectionString = Settings.Default.ConnString; | |
var changeListener = new DatabaseChangeListener(connectionString); | |
changeListener.OnChange += () => { | |
Console.WriteLine("There was a change"); | |
changeListener.Start(@ "SELECT [Name] FROM [dbo].[Cars]"); | |
}; | |
changeListener.Start(@ "SELECT [Name] FROM [dbo].[Cars]"); | |
Console.ReadLine(); | |
} | |
static void dependency_OnChange(object sender, SqlNotificationEventArgs e) | |
{ | |
Console.WriteLine("Hi!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment