asp.net-core.net-6.0sqldependency

how to get notify when someone change db manually through sqldependency?


I want to make a method which call automatically when someone make changes in DB in MSSQL Server. where I have to call this? now it's in the childHub Hub class. here are my functions but not working.

enter image description here This is code snippet

I want to notify when changes made to db.


Solution

  • We can't get more info from your code. When the data in the database is modified, you can get a message notification.

    And Rule's comment is also useful, if you want get notification in time, you should use SignalR.

    I found a good github repo for you, when the data was modified, it will send message to Dashboard.

    SignalR with SqlTableDependency in Asp.Net Core