public override Task OnDisconnected(bool stopCalled) { if (_driverService.GetAllOnlineDrivers().Where(x => x.ConnectionId == Context.ConnectionId) != null) { _driverService.RemoveOnlineDriver(Context.ConnectionId); } else if (_clientService.GetAllOnlineClients().Where(x => x.ConnectionId == Context.ConnectionId) != null) { _clientService.RemoveOnlineClient(Context.ConnectionId); } else if (_dispatcherService.GetAllOnlineDispatchers().Where(x => x.ConnectionId == Context.ConnectionId) != null) { _dispatcherService.RemoveOnlineDispatcher(Context.ConnectionId); } return(base.OnDisconnected(stopCalled)); }