Explicit database table name

In case our model has a different name from table and we cannot use Code First Data Annotations, we can manually specify table name:

    string ConnectionString = "data source=.;initial catalog=myDB;integrated security=True";

    string tableName = "Clients";

    using(var tableDependency = new SqlTableDependency<Customers>(ConnectionString, tableName))
        tableDependency.OnChanged += TableDependency_Changed;

        Console.WriteLine("Waiting for receiving notifications...");
        Console.WriteLine("Press a key to stop");

This setting override Code First Data Annotations.

Last edited Nov 14, 2015 at 4:35 PM by delbianco, version 1