ASP.NET core background service to send data through signalR
问题 I'm using signalR to send data to clients from server. What I want to is check data in the table(MSSQL DB) and send the related data to clients through signalR. So I want to create some background service to check database and send data. I planned to use System.Threading.Thread.Sleep(3000); with while(true) loop. How can I create service class to run this method in startup. Is there any method to use do this task in standard way?? 回答1: You can use an IHostedService and IHubContext to