Refresh page when database changes

Following this tutorial, I was able to update the index view when the corresponding table in the database changes. The problem occurs when I want to detect changes on a page with an index view that displays data from other tables, for example

db.Vehicles.Include(v => v.Model)

In these scenarios, it looks like the database sends event notifications one by one by calling the DispatchToClient () method of the tutorial, forcing the view to refresh itself again and again unnecessarily.

I am very new to these technologies, so any help or advice would be appreciated.

+4
source share
1

, SqlDependency , , . OnSqlDependencyChange, , , SqlNotificationEventArgs.

https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlnotificationinfo(v=vs.110).aspx

0

All Articles