Skip to content

Use case: Status change

christiandelbianco edited this page Jun 18, 2017 · 1 revision

To receive notifications about status change for TableDependency use the following code:

var tableDependency = new SqlTableDependency<Product>(connectionString);
tableDependency.OnChanged += this.TableDependency_Changed;
tableDependency.OnStatusChanged += this.TableDependency_OnStatusChanged;
tableDependency.Start();
...
private static void TableDependency_OnStatusChanged(object sender, StatusChangedEventArgs e)
{
    Console.WriteLine(@"Status: " + e.Status);
}