private void dependency_OnChange(object sender, SqlNotificationEventArgs e) { if (e.Type == SqlNotificationType.Change) { UsersHub.SendUsers(); } }
private void AddAgentOfflineInspector() { var inspector = UsersHub.GetUserOfflineInspector(ClientTenantId, ClientUserId); inspector.Task.ContinueWith(task => { if (!task.Result) { return; } Status(2); }); agentOfflineInspectors.AddOrUpdate(ClientUserId, inspector, (user, oldInspector) => { oldInspector.CancellationTokenSource.Cancel(); return(inspector); }); inspector.Task.Start(); }