Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hbulens/7407d28e0405b9877640e6164e27789a to your computer and use it in GitHub Desktop.
Save hbulens/7407d28e0405b9877640e6164e27789a to your computer and use it in GitHub Desktop.
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