-->

Route To Take With SqlDependency OnChange

2019-07-24 06:16发布

问题:

I am trying to integrate live updates in my ASP.NET WebAPI and I have hit a wall so to say. I have my application set up (using Angular on front end), and I've got it so when the page initially loads it issues a get request from my SQL database and the web page loads with this data. This data changes pretty frequently, and I want to incorporate live updates. I have my back end set up to use a SqlDependency to notify me when a change in the database occurs, but where to go from here I have no clue. I have tried to get SignalR to work with my OnChange event handler for SqlDependency but I didn't see too much online about this. I then thought it might be easier to use Angular and try polling, but again I did not see how I would incorporate this with my OnChange event handler. Any ideas on the simplest way I can communicate between the server and clients that the database has changed?